POV-Ray : Newsgroups : povray.general : vrotate question Server Time
4 Dec 2024 21:13:01 EST (-0500)
  vrotate question (Message 1 to 3 of 3)  
From: jr
Subject: vrotate question
Date: 23 Aug 2024 07:25:00
Message: <web.66c8710ff5740dfef5bfc9b06cde94f1@news.povray.org>
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.


Post a reply to this message

From: MichaelJF
Subject: Re: vrotate question
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

From: jr
Subject: Re: vrotate question
Date: 23 Aug 2024 08:30:00
Message: <web.66c88086132fa442f5bfc9b06cde94f1@news.povray.org>
hi,

MichaelJF <fri### [at] t-onlinede> wrote:
> ...
> B is a vector and so for example vrotate(P,90) is expanded to
> vrotate(p,<90,90,90>) and then:

man, unsure now whether I knew and forgot, or have been ignorant all along :-),
but thank you, _very_ much, for the explainer/reminder.


regards, jr.


Post a reply to this message

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