#VRML V2.0 utf8 # #
#[return] #

#ex-cylindersensor.wrl
# example of CylinderSensor node
# based on an example written By Fabiana
# Last Modified 05-Sept-97

#  in this example when you drag the "boxcone" object with 
#  the mouse (clicking the right button), you will cause a  
#  rotational movement in the object.



Viewpoint {position 0 0 15} 

EXTERNPROTO Cor1 [] "color.wrl#Yellow"

PROTO CylinderCone [ field SFFloat radius 2.0 
                   field SFFloat height 5.0
                   field SFNode coneApp NULL ] 
{ Transform {
         children [
              Shape { 
                geometry Box {
                            size 2 2 2 # association
                                 }
                            appearance Appearance {
                                    material Material
                                            {diffuseColor 1 0 0}
                                                   }
                     }
              Transform {
                      translation 0 -2 0
                            children [
                                   Shape {
                                       geometry Cone {
                                             height IS height
                                                      }
                                       appearance IS coneApp
                                          } 
                                       ]
                         }
                    ]
              }
}

Group {
   children [
        DEF XSENSOR CylinderSensor { autoOffset TRUE }
        DEF XFORM Transform { 
                        children CylinderCone {
                           coneApp Appearance { material Cor1 {} }
                                             }
                             }
              ]
ROUTE XSENSOR.rotation_changed TO XFORM.set_rotation
}

#