POV-Ray : Newsgroups : povray.general : Determining rotation : Re: Determining rotation Server Time
30 Jul 2024 22:25:06 EDT (-0400)
  Re: Determining rotation  
From: Chris B
Date: 11 May 2008 08:35:07
Message: <4826e7fb@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote in message 
news:4826bf28$1@news.povray.org...
> ... snip ...
> You can work out the angles, one at a time, by taking the point that you 
> get by projecting point A onto the YZ-plane (project a line through A and 
> through the YZ-plane at right angles). This point will be at <0,A.y,A.z>. 
> You can now use trigonometry to work out the two angles you're interested 
> in, or you can use the VAngleD() function from math.inc (you'll obviously 
> need to take care over angles in the different quadrants).

Sorry. I got this a bit wrong.
To get the 'Y' rotation you need to drop point A down onto the XZ-plane. The 
'Y' rotation is therefore VAngleD(z,<A.x,0,A.z>). To get the 'X' rotation 
you need to rotate point A back onto the YZ-plane so that it lies in +Z. To 
do this, use vrotate() with point A and the negative of the Y-rotation you 
just calculated. This gives you a point B on the YZ-plane that you can use 
with VAngleD(y,B) to retrieve the first rotation angle.

> ... snip ...

Regards,
Chris B.


Post a reply to this message

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