|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Is there a formula somewhere already worked out where I can plug in the
parameters to a camera object and an arbitray point in space, and determine
which is the nearest pixel corresponding to it in the image plane? Ideally,
I'd like to be able to do it with SDL inside a scene. I know that I can't
extract certain things from the camera object, but I don't have a problem
with loading them into variables first, then accessing them after the camera
declaration.
More specifically, this is (ideally) the sort of thing I want to do:
----------------------------------------
#declare Camera_Type = 1; // Perspective
#declare Camera_Location = 6*y-12*z;
#declare Camera_Look_At = 0*x;
#declare Camera_Right = image_width/image_height*x;
#declare Camera_Up = y;
#declare Camera_Angle = 45;
camera {
// Use vars above
}
#macro PixelAt(Point_Vector)
// Code goes here that takes that point and the camera
// settings, and calculates a 2D vector that corresponds
// to the nearest pixel in the output.
#end
----------------------------------------
A couple of the things I want to be able to do with it are to generate
images that occupy specific portions of the screen, and to be able to map a
"hot point" of a moving object in an animtion to apply other effects in
other software.
I've done some digging in the source code, but I haven't figured it out yet.
If somebody knows which source file and which functions I should be looking
at, that would be helpful as well.
Thanks in advance,
Jack
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Captain Jack wrote:
> A couple of the things I want to be able to do with it are to
> generate images that occupy specific portions of the screen, and to
> be able to map a "hot point" of a moving object in an animtion to
> apply other effects in other software.
You might wish to have a look at screen.inc. It should help with
the first part of your problem and provide a framework for writing
a 3d to 2d projection macro.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Christian Froeschlin" <chr### [at] chrfrde> wrote in message
news:4aef0656$1@news.povray.org...
> Captain Jack wrote:
>
>> A couple of the things I want to be able to do with it are to generate
>> images that occupy specific portions of the screen, and to be able to
>> map a "hot point" of a moving object in an animtion to apply other
>> effects in other software.
>
> You might wish to have a look at screen.inc. It should help with
> the first part of your problem and provide a framework for writing
> a 3d to 2d projection macro.
Thanks... I was so busy looking through the POV source I didn't think to
look in the scene files.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/2/2009 11:18 AM, Christian Froeschlin wrote:
> Captain Jack wrote:
>
>> A couple of the things I want to be able to do with it are to generate
>> images that occupy specific portions of the screen, and to be able to
>> map a "hot point" of a moving object in an animtion to apply other
>> effects in other software.
>
> You might wish to have a look at screen.inc. It should help with
> the first part of your problem and provide a framework for writing
> a 3d to 2d projection macro.
It only works with the perspective camera. :(
I'll see if I can fix it.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"SharkD" <mik### [at] gmailcom> wrote in message
news:4afc881b@news.povray.org...
> On 11/2/2009 11:18 AM, Christian Froeschlin wrote:
>> Captain Jack wrote:
>>
>>> A couple of the things I want to be able to do with it are to generate
>>> images that occupy specific portions of the screen, and to be able to
>>> map a "hot point" of a moving object in an animtion to apply other
>>> effects in other software.
>>
>> You might wish to have a look at screen.inc. It should help with
>> the first part of your problem and provide a framework for writing
>> a 3d to 2d projection macro.
>
> It only works with the perspective camera. :(
>
> I'll see if I can fix it.
>
> Mike
That'd be great... it seems like it should be a simple thing, I don't know
why I'm having so much trouble with it.
Historically, though, every time I think something should be easy, it turns
out that I've completely missed the subtelties of the problem. :D
--
Jack
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/13/2009 9:56 AM, Captain Jack wrote:
> That'd be great... it seems like it should be a simple thing, I don't know
> why I'm having so much trouble with it.
>
> Historically, though, every time I think something should be easy, it turns
> out that I've completely missed the subtelties of the problem. :D
>
> --
> Jack
See p.b.s-f for the new file.
What I did was make the current script work with orthographic cameras.
It does *not* calculate on-screen pixel coordinates. I'm not sure how to
go about that.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/13/2009 9:56 AM, Captain Jack wrote:
> That'd be great... it seems like it should be a simple thing, I don't know
> why I'm having so much trouble with it.
>
> Historically, though, every time I think something should be easy, it turns
> out that I've completely missed the subtelties of the problem. :D
>
> --
> Jack
I've been working on a macro that can be used with "screen.inc" to get
the screen coordinates. It is based on this thread:
http://news.povray.org/povray.advanced-users/thread/%3Cweb.48d9c9c6b4e5a4f9220734020@news.povray.org%3E/
The results aren't accurate however. Not sure what the problem is.
Mike
//BEGIN MACRO
#macro Get_Screen_Position(Loc)
#declare Screen_Position = vinv_transform(Loc, Camera_Transform);
#declare Screen_Position = <1/2 +
Screen_Position.x/vlength(CamR)/Screen_Position.z, 1/2 -
Screen_Position.y/vlength(CamU)/Screen_Position.z, 0,>;
#declare Screen_Position = Screen_Position * <image_width,
image_height, 0,>;
#end
//END MACRO
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/15/2009 6:47 PM, SharkD wrote:
> I've been working on a macro that can be used with "screen.inc" to get
> the screen coordinates. It is based on this thread:
>
>
http://news.povray.org/povray.advanced-users/thread/%3Cweb.48d9c9c6b4e5a4f9220734020@news.povray.org%3E/
>
>
> The results aren't accurate however. Not sure what the problem is.
>
> Mike
OK, I managed to figure it out. I'll upload the entire script to the
thread I started in p.b.s-f
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |