cmss Positioning, orienting and scaling objects

Finally, we present a function that allows to translate, rotate and scale an arbitrary VRML object and is useful for composing 3D setups consisting of many object.

s = vrml_transfo (str,pos,rot,scale)
translates, rotates and scales the object defined in the string str. The arguments pos and rot represent a translation and rotation respectively, just as in the vrml_frame() function. If scale is a scalar, the object str will be scaled by that amount, while if scale is a \( 3\times 1 \) vector, it represents the scaling of the X, Y and Z axes independently.
Listing 4 below and Figure 2 (right) illustrate how the two functions introduced above can be used.



Subsections

Søren Hauberg 2009-06-07