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

Home
- POV-Ray Tutorial
  Geometric
  Transformations
   - Index

    Elementary
    Transformations
    - "translate<  ... >"
    - "rotate<  ... >"
    - "scale<  ... >"
    - mirror symmetry

    Other
    Transformations
    - "matrix<  ... >"
    - Shearing
    - "transforms.inc"
    - "transform{ ...}"

    Vector
    Transformations
    - vrotate, vaxis_rotate

    Insert Menu Add-on
      & Download
 
                                       

"transform{ ... }"

= bundled transformations

With this statement it is possible to bundle a group of transformations like "scale", "rotate", "translate" and/or "matrix", in any wanted sequence by one single statement for all these transformations.
The syntax pof this statement is the following:

 #declare My_Transformation
 = transform{ Free sequence of transformations}

We use it like this:

 object{ My_Object transform My_Transformation }

Here a sample:
Sample canoes

An object called "Canoe" as well as the according hole in the surface of the water "Canoe_outside" is wanted to be placed i.e. in 3 different positions with different sizes / positions / orientations:

For this we first are defining the transformations, which lead to the wanted positions:
//------------------------------------- Positions:
#declare Canoe_Position1
  = transform { rotate< 0,30,0> translate<0.0,0,1>}
#declare Canoe_Position2
  = transform { rotate<-6,20,0> translate<1.5,0,5>}
#declare Canoe_Position3
  = transform { rotate<5, 0,0> scale 0.55
                          translate< -0.3,0,-2.00>}
//-------------------------------------------------
Then the canoes were placed there:

//---------------------- Canoes at their positions:
object{ Canoe transform Canoe_Position1}
object{ Canoe transform Canoe_Position2}
object{ Canoe transform Canoe_Position3}
//-------------------------------------------------
and also the according holes in the water:
//-------------------------------------------------
difference{
plane{<0,1,0>, 0 }
object{Canoe_outside transform Canoe_Position1 }
object{Canoe_outside transform Canoe_Position2 }
object{Canoe_outside transform Canoe_Position3 }
   texture{Polished_Chrome
                    normal {crackle 1 scale 5
                            turbulence 1
                            translate<0,0,5>}
                    finish {diffuse 0.9
                            reflection 0.40}}
          }// end of difference
//----------------------------------------------- end


translate | rotate | scale | matrix | shearing | transforms.inc | transform | vector transformations
top
© Friedrich A. Lohmüller, 2006
email email: Friedrich.Lohmueller_at_t-online.de
homepage:http://www.f-lohmueller.de