POV-Ray : Newsgroups : povray.general : vrotate implementation? Server Time
16 Nov 2024 19:19:52 EST (-0500)
  vrotate implementation? (Message 1 to 5 of 5)  
From: Jason Foster aka Guido
Subject: vrotate implementation?
Date: 28 Apr 1998 01:43:56
Message: <35456C9C.D946E883@wavetech.net>
Does anyone know of a simple or could give me a simple example of
rotating lets say a sphere around a point using vrotate?  Thanx in
advance...
-- 
        __________________________________________
       /                                         /
      /          Jason Foster, (Guido)          /
     /                                         /
    /   ICQ#:  7641872                        /
   /   email:  anc### [at] wavetechnet         /
  /  webpage:  www.wavetech.net/~ancient1   /
 /   phone #:  (612)623-4971               /
/_________________________________________/


Post a reply to this message

From: Thomas Willhalm
Subject: Re: vrotate implementation?
Date: 28 Apr 1998 03:24:23
Message: <qqm67jul87s.fsf@uni-konstanz.de>
Jason Foster aka Guido <anc### [at] wavetechnet> writes:
> 
> Does anyone know of a simple or could give me a simple example of
> rotating lets say a sphere around a point using vrotate? 

Here it is:
light_source { <10,10,10> color 1 }
camera { location <0,5,5> look_at <1,1,1> }
plane { y, 0 pigment { checker rgb <0,1,0>, rgb <1,1,1> }}
#declare deg =0
#while (deg<360)
  sphere { <1,1,1>+vrotate(<1,0,0>,deg*y), 0.3 pigment { rgb <1,0,0> } }
  #declare deg = deg +40
#end

I hope this helps.
ThW

-- 
Tho### [at] uni-konstanzde
http://www.informatik.uni-konstanz.de/~willhalm/
Tschieses lavs ju


Post a reply to this message

From: Twyst
Subject: Re: vrotate implementation?
Date: 28 Apr 1998 13:04:16
Message: <6i4utq$78h$1@oz.aussie.org>
Well, I understand vectors somewhat. I plan on doing a tutorial someday on
this... But for now, he's what I got:

Vrotate and vaxis_rotate

These both do much the same thing. they both rotate a given point.
 vrotate rotates the point around the origin, and is useful for doing
orbits, etc.
Example:

sphere { <0,0,0> 2 texture { Chrome_Metal } }
#declare Count = 0
#while (Count < 9 )
   #declare NewPoint=vrotate(<3,0,0>,<45*Count,0,0>)
   sphere { NewPoint,1 texture { Chrome_Metal pigment { Red } } }
   #declare Count = Count + 1
#end

This will make a sphere with 8 others around it in the x axis.

vaxis_rotate, on the other hand, lets you define an arbitrary axis , and
rotate the point around that.

vaxis_rotate is a little bit harder to understand.. (heh, I'm not sure if I
understand it!)
Attempt at an example:

sphere { <0,3,0> 2 texture { Chrome_Metal } }
#declare Count = 0
#while (Count < 9 )
   #declare NewPoint=vaxis_rotate(<5,0,0>,<1,1,0>,45*Count)
   sphere { NewPoint,1 texture { Chrome_Metal pigment { Red } } }
   #declare Count = Count + 1
#end


Twyst================================
EFnet and NewNet #povray Channel Operator
Website: http://www.geocities.com/~twystedmynd
E-Mail: twy### [at] v-wavecom
=====================================
Jason Foster aka Guido wrote in message <35456C9C.D946E883@wavetech.net>...
>Does anyone know of a simple or could give me a simple example of
>rotating lets say a sphere around a point using vrotate?  Thanx in
>advance...
>--
>        __________________________________________
>       /                                         /
>      /          Jason Foster, (Guido)          /
>     /                                         /
>    /   ICQ#:  7641872                        /
>   /   email:  anc### [at] wavetechnet         /
>  /  webpage:  www.wavetech.net/~ancient1   /
> /   phone #:  (612)623-4971               /
>/_________________________________________/


Post a reply to this message

From: Mike Hough
Subject: Re: vrotate implementation?
Date: 9 May 1998 05:51:58
Message: <3554273E.54AF982B@aol.com>
vaxis_rotate is not much different, and I think you get it.  It just means take
the first point and rotate it about the second point by the float amount.

vaxis_rotate (<1, 1, 1>, <2, 2, 2>, 3)

<1, 1, 1> is rotated about the point <2, 2, 2> by <3, 3, 3> degrees.

I was hoping to see it expanded to take a vector for the amount in 3.1, since
the amount as a float is equal in all directions, but I was sad to find it
'aint so.  Oh well.

-Mike

Twyst wrote:

> vaxis_rotate, on the other hand, lets you define an arbitrary axis , and
> rotate the point around that.
>
> vaxis_rotate is a little bit harder to understand.. (heh, I'm not sure if I
> understand it!)


Post a reply to this message

From: Jerry Anning
Subject: Re: vrotate implementation?
Date: 9 May 1998 21:52:12
Message: <3555084C.D8B4FD6F@dhol.com>
Mike Hough wrote:
> 
> vaxis_rotate is not much different, and I think you get it.  It just means take
> the first point and rotate it about the second point by the float amount.
> 
> vaxis_rotate (<1, 1, 1>, <2, 2, 2>, 3)
> 
> <1, 1, 1> is rotated about the point <2, 2, 2> by <3, 3, 3> degrees.
> 
> I was hoping to see it expanded to take a vector for the amount in 3.1, since
> the amount as a float is equal in all directions, but I was sad to find it
> 'aint so.  Oh well.

I'm afraid that description is not quite accurate.  As confirmed by both
experiment and source reading, vaxis_rotate(<1,1,1>, <2,2,2>, 3)
actually takes the point <1,1,1> and returns the coordinates you get by
rotating that point - about an axis that runs from <0,0,0> to <2,2,2> -
by 3 degrees.  It is just like rotating about, say the x axis by 3
degrees or the z axis by 3 degrees.  The direction of rotation follows
the left hand rule with the thumb pointed along the <0,0,0> to <2,2,2>
axis.  This is why the *angle* is not a vector.  For example, what sense
would it make to say "rotate <45,30,17> about the x axis"?  The behavior
you describe is not equivalent.  To see what is happening, make a little
scene comparing the final location of:

sphere { <1,1,1>, .2 rotate <3,3,3> translate <2,2,2> }

which is equivalent to your description and :

sphere { vaxis_rotate(<1,1,1>, <2,2,2>, 3), .2 }

(with textures, of course! :))

Jerry Anning
cle### [at] dholcom


Post a reply to this message

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