POV-Ray : Newsgroups : povray.general : Positioning a camera : Re: Positioning a camera Server Time
1 Aug 2024 20:14:55 EDT (-0400)
  Re: Positioning a camera  
From: Chris B
Date: 16 Apr 2005 19:02:56
Message: <426199a0$1@news.povray.org>
"Cesar" <ces### [at] terracombr> wrote in message
news:web.426185608db3e684b2caa48d0@news.povray.org...
> Hi! I hope I'm posting in the right place...
>
> I'm rendering a scene and the position of the camera is calculated by a
C++
> program, and I'm having some trouble.
>
> I used to set location and look-at, but now I need different movements, so
I
> decided to calculate location, direction, up and right. Then I started
> having problems. I allways get the error that says the vectors are not
> perpendicular. But I apply the same transform to the up right and
direction
> vectors, one after the other, how can they not ne perpendicular? Could
> there be a precision problem (and the inner product be sligthly different
> then zero)?
>
> How could I solve this problem? Maybe I could transform the camera inside
> povray, with "translate" and "rotate" but I'll need the up and right
> vectors later in the C++ program, so I wanted to have the same values used
> in povray.
>
> Any suggestions?
>
> Thanks!
>
> Cesar
>
>

In POVRay you could use VAngleD(V1,V2)with the up and right vectors that
your C++ program calculated to compute the angle between the vectors and use
#debug to output the result to the message window (converted to a string
with vstr()). If it is just a rounding problem you might want to use
VPerp_Adjust(V1, Axis) to adjust one of the vectors so they're
perpendicular. If it's not a rounding problem, fix the bug in your app. :-)

Chris B.


Post a reply to this message

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