POV-Ray : Newsgroups : povray.general : perspective user defined camera? : Re: perspective user defined camera? Server Time
24 Apr 2024 20:01:03 EDT (-0400)
  Re: perspective user defined camera?  
From: Tor Olav Kristensen
Date: 27 Jan 2019 03:45:00
Message: <web.5c4d6e4362f292196ac8a0470@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> ingo <ing### [at] tagpovrayorg> wrote:
> > How do I get the proper functions for defining a perspective camera as a
> > user_defined one? There's all kind of stuff I can calculate, but can't
> > get it into functions. Been at it for a few days, must say that young
> > blokes playing games a meter away doesn't help either.
> >
> > I'd like to define location look at and angle, possibly roll.
> > ...
>
> Hi Ingo
>
> The code below shows how you can transform the direction-functions for a user
> defined camera.
>...

I just noticed a problem with my code. The ordinary cameras doe not produce
exactly the same result as the user defined ones. That's because I'm not
calculating new vRight and vUp vectors after the direction vector has been
calculated. To get same results for the two camera types you can delete the
pLookAt point and set the vDirection vector "manually", e.g. like this:

#declare vDirection = 10*z;

Alternatively you can keep pLookAt and vDirection and then compose a "look at"
transformation and apply it to the vRight and vUp vectors.

--
Tor Olav
http://subcube.com


Post a reply to this message

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