Introduction to the scenery description langage of the POV-Ray Raytracer         - page 6 -
by Friedrich A. Lohmüller
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorials
 
  
POV-Ray Introduction
   Content  -  INDEX
 
  0. Working with POV-Ray:
      "Insert Menu Add-on".
  1. Basics
      on writing texts.
  2. 3D Coordinates,
      Floats and Vectors
  3. Scene Structur
      #include files,
      camera, light_source.
      Types of light sources
  4. Basic Objects plane, sphere,
      box, cylinder, cone, torus.
      Other Shapes
      height_field, text, etc.
>5. Transformations
      Streching, Turning,
      Moving and others.
      CSG: union,
      difference, intersection.
  6. Color + Surfaces       texture, pigment, normal, finish
  7. #declare, #local,
      #macro .. #end,
      #include,
      re-usable objects.
  8. #while Loops
  9. Efficiency,
      speed, flexibility,
      modulare working
      adapting from 3.1 to 3.5;3.6
      adapting from 3.5;3.6 to 3.7
      POV-Ray + Windows Vista.
 
  - Insert Menu Add-on
    & Download
                                       

V Scaling, Rotation, Translation

      For more detailed informations on this item see my Tutorial "Geometric Transformations".

3.2. Transformations:

scaling, rotation, translation and transformation matrixes.

These transformations may be applied as well as on the geometrie of an object as on e.g. his texture or on its texture components.


3.2.1 scale = scaling / resizing - enlarging or reducing in size -
The strechings are all defined relative to the center <0,0,0> or the axis or to the planes of the system of coordinates

Scaling causes a centric streching in the according direction of the coordinats relative to the center of the system of coordinates (=<0,0,0>).
Samples:
scale 2 causes the same as scale<2,2,2>: the size of the shape grows in all directions twice.
scale 0.5 in all directions together multiplied by 0.5 - this means: all reduced to its half
scale<1.0,0.5,3.0> different sizing in x- ,y- and z-direction.
Here: in x-direction original - no change, in y-direction reduced to the half and in z-direction increased to 3 times stretched.
scale<-1,1,1> mirrors an object at the yz-plane.


3.2.2 rotate / turning around -
The rotations are all defined relative to the axis of the system of coordinates!!

"rotate" causes a rotation according the "Left-thumb-rule" around the according axis of the system of coordinates.
Sample: rotate<0,45,0> turns a shape around the y-axis by 45 degrees.
Attention:> The rotations are not applied relative of any local axes of symetriy through the center of an object but everytime relative to the axes of the coordinate system.
Attention:The rotations will be applied in the writen order! Sequential rotations arround different axes are not interchangeable!


3.2.3 translate
parallel moving relatively to a starting position

"translate" causes a translation (a parallel moving) without affecting the shape of an object.
Sample: translate <-2,1,3> moves the object by 2 steps to the left (-x-direction), by 1 step upward (+y-direction) and by 3 steps ahead (+z-direction).


3.2.4 other transformations

Using the transformation matrix it is possible to realize all the above mentioned transformations as well as also much more complex affine transformations, e.g. shearing an object parallel to a coordinate plane.


CSG (Constructiv Solid Geometry)
   Boolean algebra with objects

Cut and paste and caving out by Boolean functions:

1.: union = unification of objects = connecting different objects to a new object
      (merge = used instead of union for transparent objects, if the inner borders are not wanted to be visible.
2.: difference = the rest of 1.object minus 2.object minus 3.object etc.
3.: intersection = this means those parts of all objects, which they have common with all of each other
Connect it! Subtract it! What's in both?
union{...}
oder merge{...}
difference{...} intersection{...}
union and merge difference intersection
!!! Attention: The objects to be subtracted from another have to have no coincident surfaces. It must reach unambiguous out of the first object. In the case of coincident surfaces the precision of computer calculation will be the trap: sometimes the surface is subtracted, sometimes it is not - and this will happen in an very unpredictable manner! (This error may occur only in some locations of the camera - but then it will be very very boring!)
For details see: CSG - Constructiv Solid Geometry - Boolean Algebra with Solids.
top

© Friedrich A. Lohmüller, 2009
email email: Friedrich.Lohmueller_at_t-online.de
homepage:http://www.f-lohmueller.de