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{ ...}"
       and "inverse"

    Vectors and
    Transformations

    Insert Menu Add-on
      & Download
 
                                           

"scale"   and reflection
stretching - also relative to single coordinate directions


Sample scale 640x480

#declare RedBall =
sphere{<0,0,0>,1
       texture{ pigment{ color rgb<1,0,0>}
                finish { diffuse 0.9 phong 1}}}
//--------------------- row in z direction ------
object{RedBall scale<1.00,1,1> translate<0,0, 0>}
object{RedBall scale<0.67,1,1> translate<0,0,-3>}
object{RedBall scale<0.33,1,1> translate<0,0,-6>}
object{RedBall scale<1.50,1,1> translate<0,0, 3>}
object{RedBall scale<2.50,1,1> translate<0,0, 6>}
// -------------------- row  in x direction ----
object{RedBall scale<1,4.6,1> translate<-6,0, 0>}
object{RedBall scale<1,2.0,1> translate<-3,0, 0>}
object{RedBall scale<1,0.6,1> translate< 3,0, 0>}
object{RedBall scale<1,0.3,1> translate< 6,0, 0>}
//-----------------------------------------------
scale = changing of the size
general syntax:
scale s
or with different scales in the basic directions:
scale <sx,sy,sz>
this causes a multiplication (enlargement or reduction of the size) of the dimensions of an object in all 3 basic directions. Hereby the x values (width) are multiplicated by sx, the y values (height) are multiplicated by sy and the z values (deepth) are multiplicated by sz.
Sample mirror

#declare Wheel =
union{
 // for details see my POV-Ray sample scenes
 }// end of object "Wheel"
//--------------------- 2 Wheels  ------
object{Wheel translate<1,0, 0>}
object{Wheel translate<0,0,-3> scale<-1,1,1>}
//-------------------------------------------
mirrowing at a coordinate plane:
scale <-1,1,1>
this causes an object to be mirrowed at the yz coordinate plane in x direction.

Samples:
"scale 2 global stretching in all directions to the double size.
"scale<1,1,1>" causes nothing, this means that all is shown by 1:1.
"scale<1,0.5,1>" reduces the values in y direction to the half.
"scale<2,1,1>" expands the values in x direction to double width.
"scale<-1,1,1>" mirrows an object at the yz plane in x direction.
Attention: scale <2,0,0> i.e. causes a "Parse Warning: Illegal Value: Scale X by 0.0. Changed to 1.0."
Means: Changed to scale <2,1,1> because multiplying a component with zero does not make any sense!
It's highy recommended to avoid with scale the abbreviations x, y, z. (In POV-Ray: x = <1,0,0>, y = <0,1,0>, z = <0,0,1>).  

Attention! Attention:
The step by step application of
rotation, translation and concentrical streching ("scale")
in general is not interchangeable!

The result is not the same if we mix it up - it depends on the sequence on how we apply it! While constructing scene descriptions too shallow this often is a source of many errors with a high potential of frustration!!! .

Hint:
"scale" can also be applied on shapes as well as with other "objects" like textures ("texture"), color patterns ("pigment") and simulated surface deformations ("normal").


translate | rotate | scale | matrix | shearing | transforms.inc | transform | vector transformations
top
© Friedrich A. Lohmüller, 2014
www.f-lohmueller.de