#VRML V2.0 utf8 # Aleksey Potashnik (cs184-bk) # Created on PC, NT4, IE4.0, CosmoPlayer 2.1 # Lab4 # Backgroud for slide control Transform { translation 6 0 0 children Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 }} geometry Box { size 1.0 5 0.125 }} } # Set-up of sensors and corresponding controls Group { children [ DEF SliderSen PlaneSensor { maxPosition 0.0 2.0 minPosition 0.0 -2.0 } DEF SliderCTRL Transform { center 6 0 0 children [ Transform { translation 6 0 0.125 children Shape { appearance Appearance { material Material { diffuseColor 0.2 0.2 0.2 }} geometry Box { size 0.6 0.3 0.125 }} } ] }]} Group { children [ DEF Rot1Sen CylinderSensor { minAngle -1.57 maxAngle 1.57 } DEF Rot1CTRL Transform { center 3.5 -3 0 children [ Transform { rotation 1 0 0 1.57 translation 3.5 -3 0.5 children Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 0.0 }} geometry Cylinder { radius 0.125 height 1.0 }} } Transform { translation 3.5 -3 1.0 children Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 0.0 }} geometry Cylinder { radius 0.125 height 0.4 }} }] }]} Group { children [ DEF Rot2Sen CylinderSensor { minAngle -1.57 maxAngle 1.57 } DEF Rot2CTRL Transform { center 3.5 -1 0 children [ Transform { rotation 1 0 0 1.57 translation 3.5 -1 0.5 children Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0 }} geometry Cylinder { radius 0.125 height 1.0 }} } Transform { translation 3.5 -1 1.0 children Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0 }} geometry Cylinder { radius 0.125 height 0.4 }} }] }]} Group { children [ DEF Rot3Sen CylinderSensor { minAngle -1.57 maxAngle 1.57 } DEF Rot3CTRL Transform { center 3.5 1 0 children [ Transform { rotation 1 0 0 1.57 translation 3.5 1 0.5 children Shape { appearance Appearance { material Material { diffuseColor 0.0 0.0 1.0 }} geometry Cylinder { radius 0.125 height 1.0 }} } Transform { translation 3.5 1 1.0 children Shape { appearance Appearance { material Material { diffuseColor 0.0 0.0 1.0 }} geometry Cylinder { radius 0.125 height 0.4 }} }] }]} Group { children [ DEF Rot4Sen CylinderSensor { minAngle -1.57 maxAngle 1.57 } DEF Rot4CTRL Transform { center 3.5 3 0 children [ Transform { rotation 1 0 0 1.57 translation 3.5 3 0.5 children Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 0.0 }} geometry Cylinder { radius 0.125 height 1.0 }} } Transform { translation 3.5 3 1.0 children Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 0.0 }} geometry Cylinder { radius 0.125 height 0.4 }} }] }]} ######################################################### # # Robot # ######################################################### # Background for robot's base Transform { rotation 1 0 0 -1.57 translation -2.5 -3.1 0.0 children Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 emissiveColor 0.8 0.8 0.8}} geometry Box { size 2.0 5.5 0.125 }}} # Parts of the robot Transform { rotation 1 0 0 1.57 children [ DEF SliderPart Transform { children [ Transform { rotation 1 0 0 -1.57 translation -2.5 0 2 children [ DEF Rot1Part Transform { center 0 0 0 children [ Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 0.0 }} geometry Box { size 0.4 2.2 1.0 }} Transform { rotation 1 0 0 -1.57 translation 0 1.98 0 children [ DEF Rot2Part Transform { center 0 0 -0.88 children [ Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0 }} geometry Box { size 0.8 0.32 1.76 }} Transform { translation 0 0 1.54 children [ DEF Rot3Part Transform { center 0 0 -0.66 children [ Shape { appearance Appearance { material Material { diffuseColor 0.0 0.0 1.0 }} geometry Box { size 0.24 0.6 1.32 }} Transform { rotation 0 0 1 -1.57 children [ DEF Rot4Part Transform { center 0 0 0.675 children [ # Hand Transform { scale 1.5 1.5 1.5 rotation 0 1 0 1.57 translation 0 0 0.675 children [ Transform { translation -0.125 0 0 children [ DEF cube Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 0.0 }} geometry Box { size 0.25 0.25 0.25 }} ]} Transform { translation -0.625 0 -0.25 children [ USE cube ]} Transform { translation -0.625 0 0.25 children [ USE cube ]} Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 0.0 }} geometry IndexedFaceSet { coord Coordinate { point [ -0.25 0.125 0.125 -0.5 0.125 0.375 -0.5 0.125 0.125 -0.375 0.125 0 -0.25 0.125 -0.125 -0.5 0.125 -0.375 -0.5 0.125 -0.125 -0.25 -0.125 0.125 -0.5 -0.125 0.375 -0.5 -0.125 0.125 -0.375 -0.125 0 -0.25 -0.125 -0.125 -0.5 -0.125 -0.375 -0.5 -0.125 -0.125 ]} coordIndex [0 4 5 6 3 2 1 0 -1 7 8 9 10 13 12 11 7 -1 0 1 8 7 0 -1 5 4 11 12 5 -1 2 3 10 9 2 -1 6 13 10 3 6 -1] convex FALSE solid TRUE }} ]} # End of Hand ]} ]} ]} ]} ]} ]} ]} ]} ]} ]} # End of Robot -------------------------------------------------- # Control buttons ---------------------------------------------- Group { children [ Transform { translation 8 3 0 rotation 1 0 0 1.57 children Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0 }} geometry Cylinder { radius 0.25 height 0.25}}} DEF recordNext TouchSensor {} ]} Transform { translation 7 2.2 0 children Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0 }} geometry Text { string [ "recordNext" ] fontStyle FontStyle { size 0.5 }}}} Group { children [ Transform { translation 8 1.3 0 rotation 1 0 0 1.57 children Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 1.0 }} geometry Cylinder { radius 0.25 height 0.25}}} DEF step_forward TouchSensor {} ]} Transform { translation 7 0.5 0 children Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 1.0 }} geometry Text { string [ "step_forward" ] fontStyle FontStyle { size 0.5 }}}} Group { children [ Transform { translation 8 -1.3 0 rotation 1 0 0 1.57 children Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 1.0 }} geometry Cylinder { radius 0.25 height 0.25}}} DEF step_back TouchSensor {} ]} Transform { translation 7 -0.65 0 children Shape { appearance Appearance { material Material { diffuseColor 0.0 1.0 1.0 }} geometry Text { string [ "step_back" ] fontStyle FontStyle { size 0.5 }}}} Group { children [ Transform { translation 8 -3 0 rotation 1 0 0 1.57 children Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 }} geometry Cylinder { radius 0.25 height 0.25}}} DEF saveFile TouchSensor {} ]} Transform { translation 7 -2.5 0 children Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 }} geometry Text { string [ "play/stop" ] fontStyle FontStyle { size 0.5 }}}} # Status indicator Transform { translation 5.0 -3.5 0 children [ DEF sw Switch { whichChoice 0 choice [ Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 }} geometry Text { string ["Add frame mode" "Playback from 0 frame"] length [ 0 ] fontStyle FontStyle { size 0.40 }}} Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 }} geometry Text { string ["Edit frame mode " "Playback from current frame"] length [ 0 ] fontStyle FontStyle { size 0.40 }}} Shape { appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 }} geometry Text { string ["Playback mode"] length [ 0 ] fontStyle FontStyle { size 0.40 }}} ]} ]} # End of Control Buttons --------------------------------------- DEF MainClock TimeSensor { cycleInterval 1.0 loop TRUE enabled FALSE } # Definition of Recorders -------------------------------------- DEF Joint1Recorder Script { url "recorder.class" field SFRotation currentRotation 0 1 0 0 eventIn SFRotation set_rotation eventIn SFBool recordNext eventIn SFBool saveFile eventOut SFRotation rotation_changed eventIn SFBool step_back eventIn SFBool step_forward eventOut SFInt32 stat eventIn SFFloat set_fraction eventOut SFBool ctrl_clock } DEF Joint2Recorder Script { url "recorder.class" field SFRotation currentRotation 0 1 0 0 eventIn SFRotation set_rotation eventIn SFBool recordNext eventIn SFBool saveFile eventOut SFRotation rotation_changed eventIn SFBool step_back eventIn SFBool step_forward eventOut SFInt32 stat eventIn SFFloat set_fraction eventOut SFBool ctrl_clock } DEF Joint3Recorder Script { url "recorder.class" field SFRotation currentRotation 0 1 0 0 eventIn SFRotation set_rotation eventIn SFBool recordNext eventIn SFBool saveFile eventOut SFRotation rotation_changed eventIn SFBool step_back eventIn SFBool step_forward eventOut SFInt32 stat eventIn SFFloat set_fraction eventOut SFBool ctrl_clock } DEF Joint4Recorder Script { url "recorder.class" field SFRotation currentRotation 0 1 0 0 eventIn SFRotation set_rotation eventIn SFBool recordNext eventIn SFBool saveFile eventOut SFRotation rotation_changed eventIn SFBool step_back eventIn SFBool step_forward eventOut SFInt32 stat eventIn SFFloat set_fraction eventOut SFBool ctrl_clock } ROUTE Joint1Recorder.stat TO sw.set_whichChoice ROUTE Joint1Recorder.ctrl_clock TO MainClock.set_enabled ROUTE MainClock.fraction_changed TO Joint1Recorder.set_fraction ROUTE MainClock.fraction_changed TO Joint2Recorder.set_fraction ROUTE MainClock.fraction_changed TO Joint3Recorder.set_fraction ROUTE MainClock.fraction_changed TO Joint4Recorder.set_fraction ROUTE SliderSen.translation_changed TO SliderCTRL.set_translation ROUTE SliderSen.translation_changed TO SliderPart.set_translation ROUTE Rot1Sen.rotation_changed TO Joint1Recorder.set_rotation ROUTE Joint1Recorder.rotation_changed TO Rot1Part.set_rotation ROUTE Joint1Recorder.rotation_changed TO Rot1CTRL.set_rotation ROUTE Rot2Sen.rotation_changed TO Joint2Recorder.set_rotation ROUTE Joint2Recorder.rotation_changed TO Rot2Part.set_rotation ROUTE Joint2Recorder.rotation_changed TO Rot2CTRL.set_rotation ROUTE Rot3Sen.rotation_changed TO Joint3Recorder.set_rotation ROUTE Joint3Recorder.rotation_changed TO Rot3Part.set_rotation ROUTE Joint3Recorder.rotation_changed TO Rot3CTRL.set_rotation ROUTE Rot4Sen.rotation_changed TO Joint4Recorder.set_rotation ROUTE Joint4Recorder.rotation_changed TO Rot4Part.set_rotation ROUTE Joint4Recorder.rotation_changed TO Rot4CTRL.set_rotation ROUTE recordNext.isActive TO Joint1Recorder.recordNext ROUTE step_forward.isActive TO Joint1Recorder.step_forward ROUTE step_back.isActive TO Joint1Recorder.step_back ROUTE saveFile.isActive TO Joint1Recorder.saveFile ROUTE recordNext.isActive TO Joint2Recorder.recordNext ROUTE step_forward.isActive TO Joint2Recorder.step_forward ROUTE step_back.isActive TO Joint2Recorder.step_back ROUTE saveFile.isActive TO Joint2Recorder.saveFile ROUTE recordNext.isActive TO Joint3Recorder.recordNext ROUTE step_forward.isActive TO Joint3Recorder.step_forward ROUTE step_back.isActive TO Joint3Recorder.step_back ROUTE saveFile.isActive TO Joint3Recorder.saveFile ROUTE recordNext.isActive TO Joint4Recorder.recordNext ROUTE step_forward.isActive TO Joint4Recorder.step_forward ROUTE step_back.isActive TO Joint4Recorder.step_back ROUTE saveFile.isActive TO Joint4Recorder.saveFile Viewpoint { position 1 0 12 description "Default" }