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

"rotate" overview "matrix" - shearing, etc.

Geometric Transformations

"scale"  
also relative to single coordinate directions


Sample scale 640x480

scale = changing of the size
general syntax:
scale <sx,sx,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.
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<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 xy plane in x direction.

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!!! .

// to the image above:
#declare RedBall =
 sphere{<0,0,0>,1
      texture{pigment{color Red}
         finish {ambient 0.15 diffuse 0.85 phong 1}}}
//------------------------------- row in z direction --------------
object{RedBall scale <1.00,1,1> translate <0,0, 0>} //At zero!!!
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>}
//------------------------------------------------------------------

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


"rotate" overview "matrix" - shearing, etc.

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