#VRML V2.0 utf8 # CirclefishProto.wrl # (c) Ildeniz Duman, 1998, for Kelp Forest Project # This is a proto for a Circlefish # fish size # length is 1 m -------> Y-axis # max height is 1 m ---> Z-axis # max width is 10 cm --> X-axis PROTO CircleFishProto[ exposedField MFString skinTexture [ "" ] exposedField SFVec3f fishScale 1 1 1 exposedField SFColor fishDifColor 0.5 0.5 0.5 exposedField SFColor ProtoWingColor 0.5 0.5 0.5 exposedField MFFloat PositionKey [0.0 , 0.125, 0.25, 0.375, 0.5, 0.625, 0.750, 0.875,1] exposedField MFVec3f PositionKeyValue [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] exposedField MFFloat OrientationKey [0.0 , 0.25, 0.5, 0.750, 1] exposedField MFRotation OrientationKeyValue [ 0 1 0 360 , 0 1 0 90 0 1 0 180 , 0 1 0 270, 0 1 0 360 ] exposedField SFTime OrbitTime 90 ] { DEF WAY Transform{ children Transform{ rotation 1 0 0 -80 children [ Transform{ scale IS fishScale children[ Shape { appearance Appearance { material Material { diffuseColor IS fishDifColor } texture ImageTexture{ url IS skinTexture } } geometry DEF FISH_SHAPE Extrusion { creaseAngle 0.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 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, 0 0.3 0, 0 0.2 0, 0 0 0 ] scale[ 0.03 0.03 0.05 0.3, 0.05 0.45 0.1 0.5, 0.05 0.45, 0.05 0.2, 0.03 0.4, ] } } Shape { appearance DEF FIN_SKIN Appearance { material Material { diffuseColor IS ProtoWingColor transparency 0.2 } } } Transform{ translation 0.015 0.8 -0.2 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.03 } } } Transform{ translation -0.015 0.8 -0.2 children USE EYE } Transform{ #Mouth scale 1 1 0.7 translation 0 0.98 0 children USE EYE } DEF LEFT_PECTORAL Transform{ translation 0.04 0.4 0.3 children Shape{ appearance USE FIN_SKIN geometry IndexedFaceSet { coord Coordinate{ point[ 0 0 0, 0 0.2 0, 0.2 0.1 0, ] } coordIndex[ 0, 1, 2, -1 ] solid FALSE } } } DEF RIGHT_PECTORAL Transform{ translation -0.04 0.4 0.3 children Shape{ appearance USE FIN_SKIN geometry IndexedFaceSet { coord Coordinate{ point[ 0 0 0, 0 0.2 0, -0.2 0.1 0, ] } 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 0 1 0 , 0 0.8 0, 0 0.6 0, 0 0.5 0, 0 0.3 0, 0 0.2 0, 0 0 0, # time 0.15 position 0 1 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, 0.05 0.3 0, 0.1 0.2 0, 0.2 0 0, # time 0.28 position 0 1 0 , 0 0.8 0, 0 0.6 0, 0 0.5 0, 0 0.3 0, 0 0.2 0, 0 0 0, #time 0.4 0 1 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, -0.05 0.3 0, -0.1 0.2 0, -0.2 0 0, #time .55 0 1 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, 0 0.3 0, 0 0.2 0, 0 0 0, #time 0.7 0 1 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, 0.05 0.3 0, 0.1 0.2 0, 0.2 0 0, #time 0.85 0 1 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, 0 0.3 0, 0 0.2 0, 0 0 0, #time 1 0 1 0, 0 0.8 0, 0 0.6 0, 0 0.5 0, -0.05 0.3 0, -0.1 0.2 0, -0.2 0 0, ] } DEF LEFT_PECTORAL_ROT OrientationInterpolator{ key[ 0 0.3 0.7 1 ] keyValue[ 0 1 0 -20 0 1 0 0 0 1 0 0 0 1 0 -20 ] } DEF RIGHT_PECTORAL_ROT OrientationInterpolator{ key[ 0 0.3 0.7 1 ] keyValue[ 0 1 0 20 0 1 0 0 0 1 0 0 0 1 0 20 ] } # orbiting time DEF OrbitClock TimeSensor {# route period cycleInterval IS OrbitTime loop TRUE }, DEF Orbit OrientationInterpolator{# fish path key IS OrientationKey keyValue IS OrientationKeyValue }, DEF CirclefishPath PositionInterpolator{ key IS PositionKey keyValue IS PositionKeyValue } 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 CirclefishPath.set_fraction ROUTE Orbit.value_changed TO WAY.set_rotation ROUTE CirclefishPath.value_changed TO WAY.set_translation } # end of file CirclefishProto.wrl