POV-Ray : Newsgroups : povray.advanced-users : Convert matrix to rotate ? : Re: Convert matrix to rotate ? Server Time
2 Nov 2024 03:15:55 EDT (-0400)
  Re: Convert matrix to rotate ?  
From: Rune
Date: 20 May 2000 19:18:18
Message: <39271d3a@news.povray.org>
"Tor Olav Kristensen" wrote:
> I think there must be an error in your second macro.
> The variable X (in the 3rd line) is not defined.
> Is this meant to be a lower case x ?

No, it's supposed to be VectorX. Thank you for pointing it out.
This should be correct:

#macro Vectors2Rotate (VectorX,VectorY) // by Rune S. Johansen
   #local RotZ = FindAngle(x,<VectorX.x,VectorX.y,0>,z);
   #local RotY = FindAngle(x,vrotate(VectorX,-RotZ*z),y);
   #local RotX = FindAngle(vrotate(y,<0,RotY,RotZ>),VectorY,VectorX);
   <RotX,RotY,RotZ>
#end

> And I believe your first macro could be simplified to this:
<snipped code>

Hmm, you're probably right. I just write code using my own math skills,
which means that it is not always so optimized... I will have a look your
version.

Greetings,

Rune

---
Updated April 25: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

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