#VRML V2.0 utf8 # file: bulb.wrl # Kelp - the pneumatocyst and blade # The pneumatocyst is a simple sphere and cylinder # The blade is drawn from an extrusion # Drawing an extruded shape # Joe Cannon # cs4470 # 5/12/98 added animation to the blade # 5/19/98 - twisted the blade # 5/21/98 - changed colors, made bulb smaller # 6/7/98 - added texture image ( not currently used) # 6/8/98 - reduced blade width by 50% Group { children [ # Viewpoint { # description "Far away" # position 0 0 45 # } # the pneumatocyst Group { children [ # lower stem between bulb and stipe Transform { rotation 0.0 0.0 1.0 1.571 children [ Shape { appearance Appearance { material DEF stipeColor Material { diffuseColor 0.882 0.757 0.184 } }#Appearance geometry Cylinder { radius 0.15 height 2.5 } }#Shape ] } # Transform lower stem # the bulb Transform { translation 1.8 0.0 0.0 scale 0.75 0.6 0.6 children [ Shape { appearance Appearance { material USE stipeColor } geometry Sphere { # radius 1.0 } } #Shape ] } #Transform bulb ] } #end Bulb # the extruded blade Transform { # rotation 1.0 0.0 0.0 1.9 children [ Shape { appearance Appearance { # a browner color for the blade material Material { diffuseColor 0.694 0.525 0.176 } # texture ImageTexture { url "kelp005.jpg" } # texture ImageTexture { url "../images/JeffLeitzPhotos/kelp005.jpg" } } geometry DEF BLADE_SHAPE Extrusion { creaseAngle 1.57 beginCap FALSE endCap FALSE solid FALSE crossSection [ # Slice 0.06 1.00, 0.06 -1.00 -0.06 -1.00, -0.06 1.00 ] spine [ # straight leaf 1.90 0.0 0.00, 2.5 0.0 0.00, 4.0 0.0 0.00, 7.0 0.0 0.0, 16.0 0.0 0.00, 21.00 0.0 0.00 ] scale [ # 1.0 0.2, 1.0 0.5, # 1.0 1.1, 1.0 1.5, # 1.0 0.8, 1.0 0.0 1.0 0.1, 1.0 0.3, 1.0 0.55, 1.0 0.75, 1.0 0.4, 1.0 0.0 ] orientation [ 0.0 1.0 0.0 0.0, 0.0 1.0 0.0 0.0, 0.0 1.0 0.0 0.2, 0.0 1.0 0.0 0.9, 0.0 1.0 0.0 0.45, 0.0 1.0 0.0 0.0 ] }# Extrusion }#Shape ] },# end Blade Transform ] },# Bulb and blade Group # Animation nodes DEF ANIMATOR TimeSensor { cycleInterval 6 loop TRUE } DEF BLADE_MOTION CoordinateInterpolator { key [ 0.0 0.25 0.5 0.75 1.0 ] keyValue [ # time 0.0 position 1.9 0.0 0.0, 2.5 0.0 0.0, 4.0 0.0 0.0, 7.0 0.0 0.0, 16.0 0.0 0.0, 21.0 0.0 0.0, # time 0.25 position 1.9 0.0 0.0, 2.5 0.6 0.0, 4.0 1.0 0.0, 7.0 3.0 0.0, 16.0 3.5 0.0, 21.0 0.0 0.0, # time 0.5 position 1.9 0.0 0.0, 2.5 0.0 0.0, 4.0 0.0 0.0, 7.0 0.0 0.0, 16.0 0.6 0.0, 21.0 2.0 0.0, # time 0.75 position 1.9 0.0 0.0, 2.5 -0.6 0.0, 4.0 -1.0 0.0, 7.0 -3.0 0.0, 16.0 -3.5 0.0, 21.0 0.0 0.0, # time 1.0 position 1.9 0.0 0.0, 2.5 0.0 0.0, 4.0 0.0 0.0, 7.0 0.0 0.0, 16.0 0.0 0.0, 21.0 0.0 0.0, ] } ROUTE ANIMATOR.fraction_changed TO BLADE_MOTION.set_fraction ROUTE BLADE_MOTION.value_changed TO BLADE_SHAPE.set_spine