





 
 




 
 


hi,
reading the reference for 'vrotate()'[*], I understood that all components of
'B' are used to rotate the point. yet, with the code below, both points are
identical for a given 'i_'. I expected different values of 'B' to result in
different "orbits", so, what am I doing wrong?
[*] <https://wiki.povray.org/content/Reference:Vector_Expressions#Functions>
regards, jr.
<snip>
#version 3.7;
global_settings {assumed_gamma 1}
box {0,1}
#for (i_,0,359)
#local p1_ = vrotate(<5,0,0>,<0,i_,45>);
#local p2_ = vrotate(<5,0,0>,<45,i_,45>);
#debug concat("#",str(i_,0,0)," p1 <",vstr(3,p1_,",",0,6),">.\n")
#debug concat("#",str(i_,0,0)," p2 <",vstr(3,p2_,",",0,6),">.\n")
#end
<snip>
Post a reply to this message


 
 




 
 


On 21/07/2022 3:25 pm, jr wrote:
> hi,
>
> reading the reference for 'vrotate()'[*], I understood that all components of
> 'B' are used to rotate the point. yet, with the code below, both points are
> identical for a given 'i_'. I expected different values of 'B' to result in
> different "orbits", so, what am I doing wrong?
>
> [*] <https://wiki.povray.org/content/Reference:Vector_Expressions#Functions>
>
>
> regards, jr.
>
> <snip>
> #version 3.7;
>
> global_settings {assumed_gamma 1}
> box {0,1}
>
> #for (i_,0,359)
> #local p1_ = vrotate(<5,0,0>,<0,i_,45>);
> #local p2_ = vrotate(<5,0,0>,<45,i_,45>);
> #debug concat("#",str(i_,0,0)," p1 <",vstr(3,p1_,",",0,6),">.\n")
> #debug concat("#",str(i_,0,0)," p2 <",vstr(3,p2_,",",0,6),">.\n")
> #end
> <snip>
>
vrotate(<5,0,0>,<45,i_,45>);
You moved the point along the x axis then rotated it by 45 degrees in x.
The 45 degree rotation has no effect as the point is still at y = 0, z = 0
Post a reply to this message


 
 




 
 


hi,
"m@b" <sai### [at] googlemailcom> wrote:
(thanks for swift reply)
> You moved the point along the x axis then rotated it by 45 degrees in x.
> The 45 degree rotation has no effect as the point is still at y = 0, z = 0
no visible effect for the first point, agree, but I thought the rotation would
(should!) still exist and propagate when subsequent points are calculated.
the next question, then, is how to specify a point <5,0,0> and corresponding
vrotate()s to give me two separate Xaxis rotations (as I tried with the two
rotation vectors)? do I have to precompute some point notonaxis beforehand,
or is there a "clean" way?
regards, jr.
Post a reply to this message


 
 




 
 


On 21/07/2022 6:10 pm, jr wrote:
> hi,
>
> "m@b" <sai### [at] googlemailcom> wrote:
>
> (thanks for swift reply)
>
>
>> You moved the point along the x axis then rotated it by 45 degrees in x.
>> The 45 degree rotation has no effect as the point is still at y = 0, z = 0
>
> no visible effect for the first point, agree, but I thought the rotation would
> (should!) still exist and propagate when subsequent points are calculated.
>
> the next question, then, is how to specify a point <5,0,0> and corresponding
> vrotate()s to give me two separate Xaxis rotations (as I tried with the two
> rotation vectors)? do I have to precompute some point notonaxis beforehand,
> or is there a "clean" way?
>
>
> regards, jr.
>
This is hurting my brain a bit.
Reading the docs, the rotations are around the origin (<0,0,0>) so
#local p2_ = vrotate(<5,0,0>,<45,i_,45>);
sphere{p2_, 1}
is equivalent to:
sphere{<0,0,0>, 1 translate<5,0,0> rotate<45,i_,45>}
Not quite sure what you want to achieve.
m@
Post a reply to this message


 
 




 
 


hi,
"m@b" <sai### [at] googlemailcom> wrote:
> ...
oops, replied to the email, sorry.
regards, jr.
Post a reply to this message


 
 




 
 


On 21/07/2022 8:22 pm, jr wrote:
> hi,
>
> "m@b" <sai### [at] googlemailcom> wrote:
>> ...
>
> oops, replied to the email, sorry.
My fault  I meant to reply on here, hit the wrong button.
>
>
> regards, jr
thanks for yr interest. so, point at <5,0,0>, I want to "orbit",
around Y, at an incline of 45°. rotating that amount in Z gives me
that, but the point/sphere crosses the Z axis in two places. adding a
rotation of +X _should_ to my thinking, incline the orbit such that
it goes "over" +Z and "under" Z, or vice versa. so I try to have
multiple orbits around origin, without them crossing/touching the
respective axis. (hope that makes sense) cheers.
I think what you want is this:
sphere{0, 1 translate<5,0,0> rotate<0,i_,45> rotate<45,0,0>}
i.e. apply the x rotation after the i_ thing. I don't think it is
possible using vrotate.
If you need to define the points in advance you could try this:
#local p2_ = transform {translate<5,0,0> rotate<0,i_,45> rotate<45,0,0>};
sphere{0, 1 transform p2_ }
??????

Post a reply to this message


 
 




 
 


hi,
"m@b" <sai### [at] googlemailcom> wrote:
> ...
> I think what you want is this:
>
> sphere{0, 1 translate<5,0,0> rotate<0,i_,45> rotate<45,0,0>}
>
> i.e. apply the x rotation after the i_ thing. I don't think it is
> possible using vrotate.
ah, ok, need separate rotations. (the "i_ thing" was just a placeholder for
frame_number)
> If you need to define the points in advance you could try this:
>
> #local p2_ = transform {translate<5,0,0> rotate<0,i_,45> rotate<45,0,0>};
> sphere{0, 1 transform p2_ }
thank you for the 'transform' reminder! I currently write 'sphere
{vrotate(...),...}' in the scene, so need to reorganise the sphere centres etc.
think I can make the transform into a macro :). cheers.
regards, jr.
Post a reply to this message


 
 




 
 


"jr" <cre### [at] gmailcom> wrote:
> "m@b" <sai### [at] googlemailcom> wrote:
> > ...
> > i.e. apply the x rotation after the i_ thing. I don't think it is
> > possible using vrotate.
>
> ah, ok, need separate rotations. ...
works as envisaged. thanks again.
regards, jr.
Post a reply to this message


 
 




 

