POV-Ray : Newsgroups : povray.general : From a normal to an angle? : Re: From a normal to an angle? Server Time
31 Jul 2024 22:10:35 EDT (-0400)
  Re: From a normal to an angle?  
From: Chris B
Date: 19 Aug 2006 18:50:10
Message: <44e795a2$1@news.povray.org>
> I'd fooled myself into believing I'd got it right.
>
> Regards,
> Chris B.
>

Sorry about that, I should have been using VRotationD to pick up the angle 
and I'd failed to get the correct sequence of parameters to get the 
rotational directions correct. The following should be good to go.

#include "Math.inc"

#local Norm = <1,2,3>;
//#local Norm = <-1,2,-3>;
//#local Norm = <-8,-2,4>;
//#local Norm = vrotate(y,<-46,0,-45>);

#local Z_Rotation = VRotationD(y, Norm*<1,1,0>, z);
#local X_Rotation = VRotationD(y, vrotate(Norm, -Z_Rotation*z), x);


#local Test = vrotate(y*vlength(Norm),<X_Rotation,0,Z_Rotation>);
#debug concat(vstr(3,Test,",",3,3),"\n")

Regards,
Chris B.


Post a reply to this message

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