Transform Example 1

Source


#VRML V2.0 utf8

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

DirectionalLight {
  direction 0 -1 0
}

Transform {

  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
        }   
     }
 }