#X3D V3.0 utf8 PROFILE Immersive META "filename" "SixViewpointTour2.x3dv" # [meta] reference: Web3D.org Bindable-Nodes, Viewpoint: viewpoint.wrl NavigationInfo { type ["EXAMINE" "ANY"] } Viewpoint { description "Front View " orientation 0 1 0 0 position 0 0 10 } Viewpoint { description "Rear View " orientation 0 1 0 3.14 position 0 0 -10 } Viewpoint { description "Top View" orientation 1 0 0 -1.57 position 0 10 0 } Viewpoint { description "Bottom View " orientation 1 0 0 1.57 position 0 -10 0 } Viewpoint { description "Left View " orientation 0 1 0 -1.57 position -10 0 0 } Viewpoint { description "Right View " orientation 0 1 0 1.57 position 10 0 0 } DEF Tour Viewpoint { description "Tour Views " orientation 0 1 0 0 position 0 0 10 } Background { backUrl "textures/bgBack.jpg" leftUrl "textures/bgLeft.jpg" bottomUrl "textures/bgBot.jpg" frontUrl "textures/bgFront.jpg" rightUrl "textures/bgRight.jpg" topUrl "textures/bgTop.jpg" } DEF PROX_SENSOR ProximitySensor { center 0 0 0 size 100 100 100 } DEF TRANS0 Transform { children [ Transform { translation -8 5 -20 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0 0 specularColor 0 0 0 ambientIntensity 1.0 shininess 1.0 emissiveColor 0 0 0 } } geometry DEF TYPESTRING0 Text { string [ "Select From Six typical Viewpoints and a Tour." "Current Viewpoint Position ( x y z )" "and Orientation ( x y z angle) Shown Below:"] fontStyle FontStyle { style "BOLD" } } } ] } Transform { translation -2.5 -2.5 -10 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0 0 specularColor 0 0 0 ambientIntensity 0.0 shininess 0.0 emissiveColor 1 0 0 } } geometry DEF PositionString Text { string [ "Position" ] fontStyle FontStyle { style "BOLD" } } } Transform { translation -0.5 -1 0 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0 0 specularColor 0 0 0 ambientIntensity 0.0 shininess 0.0 emissiveColor 1 0 0 } } geometry DEF OrientationString Text { string [ "Orientation" ] fontStyle FontStyle { style "BOLD" } } } ] } ] } ] } DEF PositionData Script { outputOnly MFString position inputOnly SFVec3f printPosition initializeOnly SFString space " " url "ecmascript: function printPosition (value,ts) { position = new MFString ( new String ('[ '+ Math.round(value.x*100)/100 + space + Math.round(value.y*100)/100 + space + Math.round(value.z*100)/100 + ' ]' )); } " } DEF OrientationData Script { outputOnly MFString orientation inputOnly SFRotation printOrientation initializeOnly SFString space " " url "ecmascript: function printOrientation (valueO,ts) { orientation = new MFString ( new String ('[ '+ Math.round(valueO.x*100)/100 + space + Math.round(valueO.y*100)/100 + space + Math.round(valueO.z*100)/100 + space + Math.round(valueO.angle*100)/100 + ' ]' )); } " } ROUTE PROX_SENSOR.position_changed TO PositionData.printPosition ROUTE PROX_SENSOR.orientation_changed TO OrientationData.printOrientation ROUTE PositionData.position TO PositionString.string ROUTE OrientationData.orientation TO OrientationString.string ROUTE PROX_SENSOR.position_changed TO TRANS0.set_translation ROUTE PROX_SENSOR.orientation_changed TO TRANS0.set_rotation # Box DEF boxfront Shape { appearance Appearance { material Material { } texture ImageTexture { url [ "textures/boxfront.jpg" ] } } geometry IndexedFaceSet { coordIndex [ 0 1 2 3 -1 ] coord Coordinate { point [ -1 -1 1, 1 -1 1, 1 1 1, -1 1 1 ] } texCoordIndex [ 0 1 2 3 -1 ] texCoord TextureCoordinate { point [ 0 0 1 0 1 1 0 1 ] } } } DEF boxright Shape { appearance Appearance { material Material { } texture ImageTexture { url [ "textures/boxright.jpg" ] } } geometry IndexedFaceSet { coordIndex [ 0 1 2 3 -1 ] coord Coordinate { point [ 1 -1 1, 1 -1 -1, 1 1 -1, 1 1 1 ] } texCoordIndex [ 0 1 2 3 -1 ] texCoord TextureCoordinate { point [ 0 0 1 0 1 1 0 1 ] } } } DEF boxrear Shape { appearance Appearance { material Material { } texture ImageTexture { url [ "textures/boxrear.jpg" ] } } geometry IndexedFaceSet { coordIndex [ 0 1 2 3 -1 ] coord Coordinate { point [ 1 -1 -1, -1 -1 -1, -1 1 -1, 1 1 -1 ] } texCoordIndex [ 0 1 2 3 -1 ] texCoord TextureCoordinate { point [ 0 0 1 0 1 1 0 1 ] } } } DEF boxleft Shape { appearance Appearance { material Material { } texture ImageTexture { url [ "textures/boxleft.jpg" ] } } geometry IndexedFaceSet { coordIndex [ 0 1 2 3 -1 ] coord Coordinate { point [ -1 -1 1, -1 1 1, -1 1 -1, -1 -1 -1 ] } texCoordIndex [ 1 2 3 0 -1 ] texCoord TextureCoordinate { point [ 0 0 1 0 1 1 0 1 ] } } } DEF boxtop Shape { appearance Appearance { material Material { } texture ImageTexture { url [ "textures/boxtop.jpg" ] } } geometry IndexedFaceSet { coordIndex [ 0 1 2 3 -1 ] coord Coordinate { point [ -1 1 1, 1 1 1, 1 1 -1, -1 1 -1 ] } texCoordIndex [ 0 1 2 3 -1 ] texCoord TextureCoordinate { point [ 0 0 1 0 1 1 0 1 ] } } } DEF boxbottom Shape { appearance Appearance { material Material { } texture ImageTexture { url [ "textures/boxbottom.jpg" ] } } geometry IndexedFaceSet { coordIndex [ 0 1 2 3 -1 ] coord Coordinate { point [ -1 -1 -1, 1 -1 -1, 1 -1 1, -1 -1 1 ] } texCoordIndex [ 0 1 2 3 -1 ] texCoord TextureCoordinate { point [ 0 0 1 0 1 1 0 1 ] } } } DEF TourTime TimeSensor { cycleInterval 36 loop TRUE } DEF TourPosition PositionInterpolator { key [ 0.0 0.125 0.25 0.378 0.5 0.625 0.75 0.875 1.0 ] keyValue [ 0 0 10, -10 0 0, 0 0 -10, 10 0 0, 0 0 10, 0 10 0, 0 0 10, 0 -10 0, 0 0 10 ]} DEF TourOrientation OrientationInterpolator { key [ 0.0 0.125 0.25 0.378 0.5 0.625 0.75 0.875 1.0 ] keyValue [ 0 1 0 0, 0 1 0 -1.57, 0 1 0 3.14, 0 1 0 1.57, 0 1 0 0, 1 0 0 -1.57, 0 1 0 0, 1 0 0 1.57, 0 1 0 0 ]} ROUTE TourTime.fraction_changed TO TourOrientation.set_fraction ROUTE TourOrientation.value_changed TO Tour.orientation ROUTE TourTime.fraction_changed TO TourPosition.set_fraction ROUTE TourPosition.value_changed TO Tour.position