Transform Example 4

Source

#VRML V2.0 utf8

Viewpoint {
  position 0 2 9
  orientation 0 1 0 0
}

DirectionalLight {
  direction 0 -1 0
}


#### This Transform node is made up of three different Transform
####  nodes; Cone, Cube, and Sphere.  

Transform {

#### Here the coordinate system of all three shapes is effected.
####   The scaling z axis is rotated before scaling in the x 
####   direction

  scaleOrientation 0 0 1 1.13
  scale 2 1 1

#### The translation and rotation are needed to center the the 
####   objects

  translation  -1 0 0
  rotation 0 0 1 -0.31

  children [

   #### The Cone ####
    Transform {
      translation   0 1.5 0
      children 
        Shape {
           appearance Appearance {
              material Material {
	        diffuseColor	0 1 0
	      }
           }
           geometry Cone{ 
	     height 2.0
	     bottomRadius 1.0
           }
        }
    }

   #### The Cube ####
    Transform {
      translation   -2 1.5 0
      children  
        Shape {
           appearance Appearance { 
              material Material {
                diffuseColor      0 0 1
              }
           }
           geometry Box {
 	      size 1 2.0 1
           }
        }
    }

   #### The Sphere ####
    Transform {
      translation   2 1.5 0
      children
        Shape {
           appearance Appearance {
              material Material {
                diffuseColor      1 0 0 
              }
           }
           geometry Sphere {
	      radius 1.0
           }   
        }
    }

  ]
}

#### The floor ####
 Transform {
   translation   0 0 0
   children
     Shape {
        appearance Appearance {
           material Material {
             diffuseColor      0.2 0.3 0.4
           }
        }   
        geometry Box {
           size 15 0.1 15
        }   
     }
 }