|
![](/i/fill.gif) |
"Chris B" <nom### [at] nomail com> 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
|
![](/i/fill.gif) |