POV-Ray : Newsgroups : povray.general : vrotate question : Re: vrotate question Server Time
27 Sep 2024 01:17:47 EDT (-0400)
  Re: vrotate question  
From: MichaelJF
Date: 23 Aug 2024 08:07:42
Message: <66c87b8e$1@news.povray.org>
Am 23.08.2024 um 13:22 schrieb jr:
> hi,
> 
> the manual defines: "vrotate(A,B) Rotate A about origin by B."  yet when I
> rotate a simple point, at 180 degrees the output is .. unexpected, not <-1,0,0>.
>   can someone please explain ?
> 
> 
> #version 3.8;
> 
> global_settings {assumed_gamma 1}
> box {0,1}
> 
> #declare P = <1,0,0>;
> 
> #debug concat("rot 000 : ",vstr(3,vrotate(P,0),",",0,2),"\n")
> 
> #debug concat("rot 090 : ",vstr(3,vrotate(P,90),",",0,2),"\n")
> 
> #debug concat("rot 180 : ",vstr(3,vrotate(P,180),",",0,2),"\n")
> 
> #debug concat("rot 270 : ",vstr(3,vrotate(P,270),",",0,2),"\n")
> 
> 
> 
> Persistence of Vision(tm) Ray Tracer Version 3.8.0-alpha.9945627.unofficial
> ....
> ==== [Parsing...] ==========================================================
> rot 000 : 1.00,0.00,0.00
> rot 090 : 0.00,0.00,-1.00
> rot 180 : 1.00,-0.00,-0.00
> rot 270 : 0.00,0.00,1.00
> 
> 
> regards, jr.
> 
Hi jr,

B is a vector and so for example vrotate(P,90) is expanded to 
vrotate(p,<90,90,90>) and then:

"Rotate it about the x-axis by an angle specified in degrees by the 
float value B.x. Similarly B.y and B.z specify the amount to rotate in 
degrees about the y-axis and z-axis. The result is a vector containing 
the new x,y,z coordinates of the point."

That is exactly what you got.

Best regards,
Michael


Post a reply to this message

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