#VRML V2.0 utf8 WorldInfo { title "Bird in House" } EXTERNPROTO BirdHouse [ field SFVec3f scale field SFRotation rotation field SFVec3f translation field MFString daktextuur field MFString hout field MFString url ]"opdracht1.wrl#BirdHouse" EXTERNPROTO Layer2D [ eventIn MFNode addChildren eventIn MFNode removeChildren exposedField MFNode children exposedField SFVec2f translation exposedField SFVec2f size exposedField SFNode background exposedField SFNode viewport ] ["urn:inet:blaxxun.com:node:Layer2D","http://www.blaxxun.com/vrml/protos/nodes.wrl#Layer2D","nodes.wrl#Layer2D"] EXTERNPROTO Textswitch [ exposedField SFVec3f translation exposedField SFVec3f scale exposedField SFRotation rotation exposedField MFString string exposedField SFNode appearance exposedField SFNode fontStyle eventIn SFBool isOver ] "textswitch.wrl#Textswitch" PROTO Bird [ field SFVec3f scale 1 1 1 field SFRotation rotation 0 0 0 0 field SFVec3f translation 0 0 0 exposedField SFColor pootkleur 0.282 0.220 0.176 exposedField SFColor vleugelstaartkleur 0.863 0.875 0.059 exposedField SFColor snavelkleur 0.945 0.471 0.024 exposedField SFColor lichaamskleur 0.024 0.133 0.945 eventOut SFBool tailOver eventOut SFBool bodyOver eventOut SFBool wingOver eventOut SFBool headOver eventOut SFBool eyeOver eventOut SFBool beakOver eventOut SFBool feetOver eventOut SFTime beaktouchTime exposedField MFString birdSongurl "song.wav" eventOut SFTime tailtouchTime eventOut SFTime bodytouchTime eventOut SFTime wingtouchTime eventOut SFTime headtouchTime eventOut SFTime eyetouchTime eventOut SFTime feettouchTime ] { Transform { scale IS scale rotation IS rotation translation IS translation children [ Transform { rotation 1 0 0 -1.57 children [ #Tail DEF Tail Transform { scale 0.01 0.05 0.001 translation 0 -0.015 0.01 children [ Shape { appearance Appearance { material Material { diffuseColor IS vleugelstaartkleur } } geometry Cone { } } DEF touchTail TouchSensor { touchTime IS tailtouchTime isOver IS tailOver } DEF TailTimer TimeSensor { startTime 0 cycleInterval 0.5 } DEF AnimationTail OrientationInterpolator { key [0.00 0.5 1.00] keyValue [ 0 0 0 0, 1 0 0 -0.49 0 0 0 0] } ] ROUTE touchTail.touchTime TO TailTimer.startTime ROUTE TailTimer.fraction_changed TO AnimationTail.set_fraction ROUTE AnimationTail.value_changed TO Tail.rotation } # Body Transform { scale 0.02 0.04 0.02 children [ Shape { appearance Appearance { texture ImageTexture { } material Material { diffuseColor IS lichaamskleur } } geometry Sphere { } } DEF touchBody TouchSensor { touchTime IS bodytouchTime isOver IS bodyOver } ] } #Wing1 DEF Wing1 Transform { scale 0.035 0.005 0.03 translation 0.015 0.005 0 rotation 0 0 1 4.7 children [ Shape { appearance Appearance { material Material { diffuseColor IS vleugelstaartkleur } } geometry Extrusion { crossSection [0 0.5, 1 0, 0 0, 0 0.5] solid FALSE } } DEF touchWing TouchSensor { touchTime IS wingtouchTime isOver IS wingOver } DEF WingTimer TimeSensor { startTime 0 cycleInterval 0.5 } DEF AnimationWing1 OrientationInterpolator { key [0.00 0.5 1.00] keyValue [ 0 0 1 4.7, 0 0 1 5.7 0 0 1 4.7 ] } ] ROUTE touchWing.touchTime TO WingTimer.startTime ROUTE WingTimer.fraction_changed TO AnimationWing1.set_fraction ROUTE AnimationWing1.value_changed TO Wing1.rotation } #Wing1a DEF Wing1a Transform { scale 0.008 0.003 0.008 translation 0.017 0.005 0.007 rotation 0 0 1 4.7 children [ Shape { appearance Appearance { texture ImageTexture { } material Material { diffuseColor IS vleugelstaartkleur } } geometry Cylinder { } } USE touchWing DEF AnimationWing1a OrientationInterpolator { key [0.00 0.5 1.00] keyValue [ 0 0 1 4.7, 0 0 1 5.7 0 0 1 4.7 ] ROUTE touchWing.touchTime TO WingTimer.startTime ROUTE WingTimer.fraction_changed TO AnimationWing1a.set_fraction ROUTE AnimationWing1a.value_changed TO Wing1a.rotation } ] } #Wing2 DEF Wing2 Transform { scale 0.035 0.005 0.03 translation -0.02 0.005 0 rotation 0 0 1 4.7 children [ Shape { appearance Appearance { material Material { diffuseColor IS vleugelstaartkleur } } geometry Extrusion { crossSection [0 0.5, 1 0, 0 0, 0 0.5] solid FALSE } } USE touchWing DEF AnimationWing2 OrientationInterpolator { key [0.00 0.5 1.00] keyValue [ 0 0 1 4.7, 0 0 1 3.7, 0 0 1 4.7 ] } ] ROUTE touchWing.touchTime TO WingTimer.startTime ROUTE WingTimer.fraction_changed TO AnimationWing2.set_fraction ROUTE AnimationWing2.value_changed TO Wing2.rotation } #Wing2a DEF Wing2a Transform { scale 0.008 0.003 0.008 translation -0.017 0.005 0.007 rotation 0 0 1 4.7 children [ Shape { appearance Appearance { texture ImageTexture { } material Material { diffuseColor IS vleugelstaartkleur } } geometry Cylinder { } } USE touchWing DEF AnimationWing2a OrientationInterpolator { key [0.00 0.5 1.00] keyValue [ 0 0 1 4.7, 0 0 1 3.7, 0 0 1 4.7 ] ROUTE touchWing.touchTime TO WingTimer.startTime ROUTE WingTimer.fraction_changed TO AnimationWing2a.set_fraction ROUTE AnimationWing2a.value_changed TO Wing2a.rotation } ] } #Head Transform { scale 0.012 0.012 0.014 translation 0 0.033 0.015 children [ Shape { appearance Appearance { texture ImageTexture { } material Material { diffuseColor IS lichaamskleur } } geometry Sphere { } } DEF touchHead TouchSensor { touchTime IS headtouchTime isOver IS headOver } ] } #Eye1 Transform { scale 0.002 0.002 0.002 translation 0.004 0.042 0.019 children [ Shape { appearance Appearance { material DEF Eyeflash Material { diffuseColor 1 1 1 #0.945 0.471 0.024 } } geometry Sphere { } } DEF touchEye TouchSensor { touchTime IS eyetouchTime isOver IS eyeOver } DEF EyeTimer TimeSensor { startTime 0 cycleInterval 0.5 } DEF AnimationEye ColorInterpolator { key [0.00 0.5 1.00] keyValue [ 1 1 1, 1 0 0, 1 1 1 #0.945 0.471 0.024 ] } ] ROUTE touchEye.touchTime TO EyeTimer.startTime ROUTE EyeTimer.fraction_changed TO AnimationEye.set_fraction ROUTE AnimationEye.value_changed TO Eyeflash.diffuseColor } #Eye2 Transform { scale 0.002 0.002 0.002 translation -0.004 0.042 0.019 children [ Shape { appearance Appearance { material USE Eyeflash } geometry Sphere { } } USE touchEye ] } #Eye2a Transform { scale 0.0012 0.0012 0.0012 translation -.0044 0.0428 0.0192 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0 0 } } geometry Sphere { } } USE touchEye ] } #Eye1a Transform { scale 0.0012 0.0012 0.0012 translation 0.0044 0.0428 0.0192 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0 0 } } geometry Sphere { } } USE touchEye ] } #Beak1 Transform { scale 0.005 0.008 0.0035 translation 0 0.047 0.015 children [ Shape { appearance Appearance { material Material { diffuseColor IS snavelkleur } } geometry Cone { } } DEF touchBeak TouchSensor { touchTime IS beaktouchTime isOver IS beakOver } Shape { appearance Appearance { texture DEF BirdSong MovieTexture { url IS birdSongurl } } geometry Sphere { radius 0 } } ] ROUTE touchBeak.touchTime TO BirdSong.startTime } #Beak2 Transform { scale 0.005 0.008 0.002 translation 0 0.047 0.016 children [ Shape { appearance Appearance { material Material { diffuseColor IS snavelkleur } } geometry Cone { } } USE touchBeak ] } # Feet1 Transform { scale 0.0012 0.015 0.0015 translation -0.008 -0.01 -0.02 rotation 1 0 0 1.57 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } DEF touchFeet TouchSensor { touchTime IS feettouchTime isOver IS feetOver} ] } # Feet2 Transform { scale 0.0012 0.015 0.0015 translation 0.008 -0.01 -0.02 rotation 1 0 0 1.57 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } # Feet1a Transform { scale 0.0012 0.01 0.0015 translation -0.008 -0.005 -0.035 rotation 0 1 0 1.57 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } # Feet2a Transform { scale 0.0012 0.01 0.0015 translation 0.008 -0.005 -0.035 rotation 0 1 0 1.57 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } # Feet1b Transform { scale 0.0012 0.005 0.0015 translation -0.012 -0.005 -0.035 rotation 0 0 1 0.6 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } # Feet2b Transform { scale 0.0012 0.005 0.0015 translation 0.010 -0.005 -0.035 rotation 0 0 1 -0.6 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } # Feet1c Transform { scale 0.0012 0.005 0.0015 translation -0.004 -0.005 -0.035 rotation 0 0 1 -0.6 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } # Feet2c Transform { scale 0.0012 0.005 0.0015 translation 0.004 -0.005 -0.035 rotation 0 0 1 0.7 children [ Shape { appearance Appearance { material Material { diffuseColor IS pootkleur } } geometry Cylinder { } } USE touchFeet ] } ] } ] } } NavigationInfo { type "EXAMINE" } Viewpoint { position -0.3 0 0.45 orientation 0 1 0 -0.6 } Transform { rotation 0 1 0 1.7 children [ Transform { translation -0.065 -0.09 0 #rotation 1 0 0 -1.57 children [ DEF Birdo Bird {} ] } ] } BirdHouse { } Layer2D { children [ Transform { translation 0.75 0.45 0 children [ Shape { appearance Appearance { texture ImageTexture { url "blauw.png" } } geometry Box { size 0.5 0.25 0.5 } } Transform { translation 0 0 0 scale 0.1 0.1 0.1 children [ DEF Tailtext Textswitch { string "Tail" } DEF Bodytext Textswitch { string "Body" } DEF Wingtext Textswitch { string "Wing" } DEF Headtext Textswitch { string "Head" } DEF Eyetext Textswitch { string "Eye" } DEF Beaktext Textswitch { string "Beak" } DEF Feettext Textswitch { string "Feet" } ] } Transform { translation 0 -0.10 0 scale 0.05 0.05 0.05 children [ DEF Tailtext2 Textswitch { string "Click for movement" } DEF Wingtext2 Textswitch { string "Click for movement" } DEF Eyetext2 Textswitch { string "Click for effect" } DEF Beaktext2 Textswitch { string "Click for bird song" } ] } ] } ] } ROUTE Birdo.tailOver TO Tailtext.isOver ROUTE Birdo.bodyOver TO Bodytext.isOver ROUTE Birdo.wingOver TO Wingtext.isOver ROUTE Birdo.headOver TO Headtext.isOver ROUTE Birdo.eyeOver TO Eyetext.isOver ROUTE Birdo.beakOver TO Beaktext.isOver ROUTE Birdo.feetOver TO Feettext.isOver ROUTE Birdo.tailOver TO Tailtext2.isOver ROUTE Birdo.wingOver TO Wingtext2.isOver ROUTE Birdo.eyeOver TO Eyetext2.isOver ROUTE Birdo.beakOver TO Beaktext2.isOver # beak - song + # eye - colour change # tail - move up/down # wings - move left/right - up/down # head - turn