#VRML V2.0 utf8 # HalfmoonProto.wrl # Ildeniz Duman, 1998, for Kelp Forest Project # This is a proto for a Halfmoon PROTO HalfmoonProto[ exposedField MFString skinTexture [ "halfmoonScalesPatch.jpg" ] exposedField SFVec3f fishScale 0.3 0.25 0.25 exposedField SFColor fishDifColor 0.7 0.7 0.7 ] { Transform{ scale IS fishScale children[ DEF MyHalfmoon Transform{ translation 5 0 0 #rotation 1 0 0 90 # unutma children [ Shape { appearance Appearance { material Material { diffuseColor IS fishDifColor } texture ImageTexture{ url IS skinTexture } } geometry DEF FISH_SHAPE Extrusion { creaseAngle 1.57 crossSection [ -0.1 1.0 ,0.1 1,0.5 0.5, 0.5 -0.5, 0.1 -1,-0.1 -1, -0.5 -0.5, -0.5 0.5, -0.1 1 ] spine [ 0 1.5 0, 0 1.2 0, 0 0.5 0, 0 0.3 0, 0 0 0, 0 -0.3 0 ] scale[ 0.03 0.03 0.3 0.3, 0.2 0.4, 0.1 0.5, 0.1 0.15, 0.03 0.4, ] } } Shape { appearance DEF FIN_SKIN Appearance { material Material { diffuseColor 0.5 0.5 0.5 transparency 0.2 } } } Transform{ translation 1.37 0.1 0.1 children DEF EYE Shape{ appearance Appearance { material Material { shininess 1 diffuseColor 0.5 0.5 0.5 specularColor 0.3 0.3 0.3 } } geometry Sphere{ radius 0.04 } } } Transform{ translation 1.37 0.1 -0.1 children USE EYE } Transform{ #Mouth scale 2.6 1 0.7 translation 1.46 0 0 children USE EYE } DEF LEFT_PECTORAL Transform{ translation 1.1 -0.15 -0.1 children Shape{ appearance USE FIN_SKIN geometry IndexedFaceSet { coord Coordinate{ point[ 0 0 0, 0.2 0 0, -0.2 0 -0.2, ] } coordIndex[ 0, 1, 2, -1 ] solid FALSE } } } DEF RIGHT_PECTORAL Transform{ translation 1.1 -0.15 0.1 children Shape{ appearance USE FIN_SKIN geometry IndexedFaceSet { coord Coordinate{ point[ 0 0 0, 0.2 0 0, -0.2 0 0.2, ] } coordIndex[ 0, 1, 2, -1 ] solid FALSE } } } ] } DEF TIMER TimeSensor { cycleInterval 5 loop TRUE } DEF WAGGLER CoordinateInterpolator { key [ 0.0, 0.15,0.28,0.4,0.55,0.7,0.85,1] keyValue [ # time 0.0 position 1.5 0 0, 1.2 0 0, 0.5 0 0, 0.3 0 0, 0 0 0, -0.3 0 0, # time 0.15 position 1.5 0 0, 1.20 0 0, 0.5 0 .1 , 0.3 0 .2, 0 0 0.25 , -0.3 0 0.3 , # time 0.28 position 1.5 0 0, 1.20 0 0, 0.5 0 0, 0.3 0 0, 0 0 0, -0.3 0 0, #time 0.4 1.5 0 0, 1.2 0 0, 0.5 0 -0.1, 0.3 0 -0.2, 0 0 -0.25, -0.3 0 -0.3, #time .55 1.5 0 0, 1.2 0 0, 0.5 0 0, 0.3 0 0, 0 0 0, -0.3 0 0, #time 0.7 1.5 0 0, 1.2 0 0, 0.5 0 0.1, 0.3 0 0.2, 0 0 0.25, -0.3 0 0.3, #time 0.85 1.5 0 0, 1.2 0 0, 0.5 0 0, 0.3 0 0, 0 0 0, -0.3 0 0, #time 1 1.5 0 0, 1.2 0 0, 0.5 0 -0.1, 0.3 0 -0.2, 0 0 -0.25, -0.3 0 -0.3, ] } DEF LEFT_PECTORAL_ROT OrientationInterpolator{ key[ 0 0.3 0.7 1 ] keyValue[ 1 0 0 -30 1 0 0 0 1 0 0 0 1 0 0 -30 ] } DEF RIGHT_PECTORAL_ROT OrientationInterpolator{ key[ 0 0.3 0.7 1 ] keyValue[ 1 0 0 -30 1 0 0 0 1 0 0 0 1 0 0 -30 ] } # orbiting time DEF OrbitClock TimeSensor {# route period cycleInterval 90.0 loop TRUE }, DEF Orbit OrientationInterpolator{# fish path key [0.0 , 0.25, 0.5, 0.750, 1] keyValue[ 0 1 0 360 0 1 0 90 0 1 0 180 0 1 0 270 0 1 0 360 ] }, DEF HalfmoonPath PositionInterpolator{ key [0.0 , 0.125, 0.25, 0.375, 0.5, 0.625, 0.750, 0.875,1] keyValue [15 2 0, 15 0 -10, 0 -1 -10, -15 0 -10, -15 2 0 , -15 0 10, 0 -2 10, 15 0 10, 15 2 0] } ] } ROUTE TIMER.fraction_changed TO WAGGLER.set_fraction ROUTE WAGGLER.value_changed TO FISH_SHAPE.set_spine ROUTE TIMER.fraction_changed TO LEFT_PECTORAL_ROT.set_fraction ROUTE LEFT_PECTORAL_ROT.value_changed TO LEFT_PECTORAL.set_rotation ROUTE TIMER.fraction_changed TO RIGHT_PECTORAL_ROT.set_fraction ROUTE RIGHT_PECTORAL_ROT.value_changed TO RIGHT_PECTORAL.set_rotation ROUTE OrbitClock.fraction_changed TO Orbit.set_fraction ROUTE OrbitClock.fraction_changed TO HalfmoonPath.set_fraction ROUTE Orbit.value_changed TO MyHalfmoon.set_rotation ROUTE HalfmoonPath.value_changed TO MyHalfmoon.set_translation } # end of file HalfmoonProto.wrl