Descriptions and Samples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Italiano Italiano
Français français
Deutsch Deutsch

"translate" - move overview "scale"

Geometric Transformations

"rotate"  
arround one or more axes of the coordinate system


rotation demo
rotate = rotieren, drehen
general syntax:
rotate <wx,wx,wz>
this causes a rotation of an object arround the appropriated coordinate axis of the three basic directions
by an angle of wx degrees arround the x axis
by an angle of wy degrees arround the y axis and
by an angle of wz degrees arround the z axis.
Attention: The rotations are not applied relative of any local axes of symetriy through the center of an object and the rotations will be applied in the writen order!

"rotate< 0,90, 0>" causes a rotation arround the y axis by 90 degrees (lefthanded positive).
"rotate< 0,90,45>" first causes a rotation arround the y axis by 90 degrees and then a rotation arround the z axis by 45 degrees.
"rotate< 0, 0,45> rotate< 0,90, 0>" first causes a rotation of 45 degrees arround the z axis
followed by a rotation of 90 degrees arround the y axis.

Be aware:
Sequential rotations arround different axes
are not interchangeable!

This means the result depends on the order in which we apply these rotations! High potential of frustration if we are not carefully enough!!!.

Samples rotation 640x480

Sample 1:

#declare YellowSmarty =
sphere{<0,0,0>,1
       scale <1,0.5,1>
       translate<4,0,0>
       texture{
          pigment{color rgb<1,0.65,0>}
          finish {ambient 0.15
                  diffuse 0.85
                  phong 1}}} //--
object{YellowSmarty rotate<0,0, 90>}
object{YellowSmarty rotate<0,0,105>}
object{YellowSmarty rotate<0,0,120>}
object{YellowSmarty rotate<0,0,135>}
object{YellowSmarty rotate<0,0,150>}
object{YellowSmarty rotate<0,0,165>}
object{YellowSmarty rotate<0,0,180>}
//---------------------------------
#declare Zylinder_1 =
cylinder{<0,0,0>,<0,3,0>,0.2
         translate<0,0,5>
         texture{
           pigment{color NeonPink}
           finish {ambient 0.15
                   diffuse 0.85
                   phong 1}}} //--
object{Zylinder_1 rotate<0,  0,0>}
object{Zylinder_1 rotate<0, 15,0>}
object{Zylinder_1 rotate<0, 30,0>}
object{Zylinder_1 rotate<0, 45,0>}
object{Zylinder_1 rotate<0, 60,0>}
object{Zylinder_1 rotate<0, 75,0>}
object{Zylinder_1 rotate<0, 90,0>}
object{Zylinder_1 rotate<0,105,0>}
object{Zylinder_1 rotate<0,120,0>}
object{Zylinder_1 rotate<0,135,0>}
object{Zylinder_1 rotate<0,150,0>}
object{Zylinder_1 rotate<0,165,0>}
object{Zylinder_1 rotate<0,180,0>}
//----------------------------------
Samples rotation 640x480

Sample 2:

#declare Ring=
union{
object{YellowSmarty rotate<0,  0,0>}
object{YellowSmarty rotate<0, 30,0>}
object{YellowSmarty rotate<0, 60,0>}
object{YellowSmarty rotate<0, 90,0>}
object{YellowSmarty rotate<0,120,0>}
object{YellowSmarty rotate<0,150,0>}
object{YellowSmarty rotate<0,180,0>}
object{YellowSmarty rotate<0,210,0>}
object{YellowSmarty rotate<0,240,0>}
object{YellowSmarty rotate<0,270,0>}
object{YellowSmarty rotate<0,300,0>}
object{YellowSmarty rotate<0,330,0>}
cylinder{<0,-1,0>,<0,1,0>,0.2
         texture{
            pigment{color NeonPink}
            finish {ambient 0.15
                    diffuse 0.85
                    phong 1} } }
}// end of union //---------------
 object{Ring}
 object{Ring translate<4,1,4> }
//--------------------------------

Hint:
"rotate" can also be used with geometric shapes as well as with other objects like light sources, textures("texture"), color patterns ("pigment") and simulated surface deformations ("normal").


"translate" - move overview "scale"

© Friedrich A. Lohmüller, 2004
email email: (legacy email redacted)
homepage:www.f-lohmueller.de