POV-Ray : Newsgroups : povray.advanced-users : Pixel position from 3D coordinates : Re: Pixel position from 3D coordinates Server Time
3 Jul 2024 05:07:40 EDT (-0400)
  Re: Pixel position from 3D coordinates  
From: SharkD
Date: 14 Nov 2009 23:10:00
Message: <web.4aff7e3f3cca20e6dd0f83970@news.povray.org>
"Mark Weyer" <nomail@nomail> wrote:
> First, assume your camera is
>
>   camera {
>     location 0
>     direction z
>     right A*x
>     up B*y
>   }
>
> for some numbers A and B. Then the 3D coordinate <X,Y,Z> will be rendered
> at the pixel ( (X/(A*Z)-1/2)*W , (1/2-Y/(B*Z))*H ). Your actual camera is
> equivalent to one of this form with some rotates and translates applied.
> Then, apply the inverses of these rotates and translates, in reverse order,
> to the 3D coordinate beforehand.
> How your camera is equivalent to one of the above form, I cannot tell, at
> least not from the top of my head, because I never use angle or look_at.
>
> > Anyway, Thanks Mark and others who responded.
>
> Welcome.
>
>   Mark Weyer

What if your camera's right, up and directions aren't x, y and z (lowercase).

Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.