#VRML V2.0 utf8 WorldInfo { title "MMA Assignment 2" info ["Aäron Jansen" "Studentnumber: 1262602" "Studying: AI" "ajansen@few.vu.nl"] } PROTO logo [ exposedField MFString url [ "index.html" ] exposedField SFVec3f translation 0 0 0 exposedField SFVec3f scale 1 1 1 ] { Transform { scale IS scale translation IS translation children [ Anchor { url IS url children [ Shape { appearance Appearance { texture ImageTexture { url "earth1-texture.jpg" } } geometry Sphere { radius 0.75 } } Shape { appearance Appearance { material Material { diffuseColor 0.5 0.5 0.5 emissiveColor 0.5 0.5 0.5 transparency 0.9 } } geometry Box { size 2 2 2 } } ] description "Back to Home" } Transform { translation 0 -1.2 2.01 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Text { string "World in a Box" fontStyle FontStyle { size 0.5 family "SANS" style "BOLD" justify "MIDDLE" } } } ] } ] } } logo { url "../index.html" scale 0.5 0.5 0.5 translation -5 2.5 0 } # The Earth part Group { children [ DEF EARTHTOUCHSENSOR TouchSensor {} Shape { appearance Appearance { texture ImageTexture { url "earth1-texture.jpg" } } geometry Sphere { radius 0.75 } } ] } DEF EARTHPOPUP_SCRIPT Script { eventIn SFBool isOver eventOut SFInt32 output url "javascript: function isOver(value, time){ if (value == true) { output = 2; } else { output = 0; } } " } # The glass box part Group { children [ DEF GLASSTOUCHSENSOR TouchSensor {} Transform { translation 0 3 0 children [ Shape { appearance Appearance { material Material { diffuseColor 0.5 0.5 0.5 emissiveColor 0.5 0.5 0.5 transparency 0.9 } } geometry Box { size 2 2 2 } } ] } ] } DEF GLASSPOPUP_SCRIPT Script { eventIn SFBool isOver eventOut SFInt32 output url "javascript: function isOver(value, time){ if (value == true) { output = 1; } else { output = 0; } } " } # The foot of the world in a box Group { children [ DEF FOOTTOUCHSENSOR TouchSensor {} Transform { translation 0 -2.5 0 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 1 emissiveColor 0.1 0.1 0.1 transparency 0.0 } } geometry Box { size 2 0.5 2 } } ] } ] } DEF FOOTPOPUP_SCRIPT Script { eventIn SFBool isOver eventOut SFInt32 output url "javascript: function isOver(value, time){ if (value == true) { output = 3; } else { output = 0; } } " } #infoscreen Transform { translation 4 0 0 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0.6 1 emissiveColor 0.1 0.1 0.1 transparency 0.0 } } geometry Box { size 4 6 0.1 } } ] } DEF SWITCHTEXT Switch { whichChoice 0 # Text on the infoscreen choice [ Transform { translation 4 2.5 0.1 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Text { string [ "InfoScreen" "" "'Your own virtual" "world in a" "glass box'" "" "Move the mouse" "over seperate" "parts for info" ] fontStyle FontStyle { size 0.5 family "SANS" style "BOLD" justify "MIDDLE" } length [3] } } ] } Transform { translation 4 2.5 0.1 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Text { string [ "InfoScreen" "" "The glass box" "protects the" "earth part" ] fontStyle FontStyle { size 0.5 family "SANS" style "BOLD" justify "MIDDLE" } length [3] } } ] } Transform { translation 4 2.5 0.1 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Text { string [ "InfoScreen" "" "Earth part" "" "Your own virtual" "earth, just 4 you." ] fontStyle FontStyle { size 0.5 family "SANS" style "BOLD" justify "MIDDLE" } length [3] } } ] } Transform { translation 4 2.5 0.1 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Text { string [ "InfoScreen" "" "The foot carries" "the earth in a" "special way," "such that it" "floats in the air." ] fontStyle FontStyle { size 0.5 family "SANS" style "BOLD" justify "MIDDLE" } length [3] } } ] } ] } # All viewpoints in a group Group { children [ DEF default Viewpoint { position 2 7 10 orientation -0.95 0.30 0.09 0.63 } DEF norm Viewpoint { position 0 0 10 description "Normal Entry" } DEF aerial Viewpoint { position 0 5 10 orientation 1 0 0 -0.39 description "Aerial View" } DEF aerial-side Viewpoint { position 5 5 5 orientation -0.59 0.77 0.24 0.99 description "Aerial View: To the side" } ] } Background { skyColor 0.2 0.2 0.2 } # Routing for the text information in the infoscreen ROUTE EARTHTOUCHSENSOR.isOver TO EARTHPOPUP_SCRIPT.isOver ROUTE EARTHPOPUP_SCRIPT.output TO SWITCHTEXT.whichChoice ROUTE GLASSTOUCHSENSOR.isOver TO GLASSPOPUP_SCRIPT.isOver ROUTE GLASSPOPUP_SCRIPT.output TO SWITCHTEXT.whichChoice ROUTE FOOTTOUCHSENSOR.isOver TO FOOTPOPUP_SCRIPT.isOver ROUTE FOOTPOPUP_SCRIPT.output TO SWITCHTEXT.whichChoice