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

"matrix" - shearing, etc. overview

Geometric Transformations

"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 {ambient 0.15 diffuse 0.45
                            reflection 0.40}}
          }// end of difference
//----------------------------------------------- end


"matrix" - shearing, etc. overview

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