Rotation of objects in VRML

Rotation of objects is quite frequently required. Even if your are not including an object definined in another file, you most likely will need to rotate a primite shape to incorporate it into your world.

Rotation is specified as an option of the Transform node. Generally, the syntax for a rotation is:

Transform {
	rotation 0 1 0 1.57
	child ...
}
Note that the first three arguments to the rotation field are the axes to rotate the object about. In this case, we only rotate about the Y axis. The last argument is a floating point value representing the number of radians to rotate the object. Note that the conversion from degrees to radians is # of degrees*PI/180.