Scale (Transform Node)


#VRML V2.0 utf8
Transform{
scale 3 2 1
children[
Shape{
geometry Box{}
}]}
#add an un-scaled Box
#for comparison
Transform{
translation -5 0 0
children[
Shape{
geometry Box{}
}]}

A quick glance at this example reveals exactly what the scale node does. Compare the two boxes. A scale field scales the children of a Transform node by the values given. In our case:

scale 3 2 1

will multiply the Box's size by three in the x direction, two in the y direction, and one in the z direction. The values in a scale affect EVERY x, y & z value for ALL the nested nodes in the children field. This will mean more later. One thing to note is that if you scale a Box{} that already has size, both the scale and the size affect the Box. That is:

#VRML V2.0 utf8
#scale, without affect

Transform{
scale 3 1 1
children[
Shape{
geometry Box{ size 1 3 3 }
}]}

Will look like a cube.


[ Next ] [ Previous ]