|
![](/i/fill.gif) |
"Cesar" <ces### [at] terra com br> 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
|
![](/i/fill.gif) |