Presentation is loading. Please wait.

Presentation is loading. Please wait.

Viewpoint and Animation Example: Bus. Sensors DEF BusTimer TimeSensor { cycleInterval 120 loop FALSE} DEF BusSensor ProximitySensor {center 0 1.5.

Similar presentations


Presentation on theme: "Viewpoint and Animation Example: Bus. Sensors DEF BusTimer TimeSensor { cycleInterval 120 loop FALSE} DEF BusSensor ProximitySensor {center 0 1.5."— Presentation transcript:

1 Viewpoint and Animation Example: Bus

2

3

4

5 Sensors DEF BusTimer TimeSensor { cycleInterval 120 loop FALSE} DEF BusSensor ProximitySensor {center 0 1.5 0 size 8 3 3}

6 Proximity Sensor ProximitySensor { exposedField SFVec3f center0 0 0 exposedField SFVec3fsize0 0 0 exposedField SFBoolenable TRUE evenOutSFBoolisActive eventOutSFVec3fposition_changed eventOutSFRotationorientation_changed eventOutSFTimeenterTime eventOutSFTimeexitTime }

7

8 DEF BusPosition PositionInterpolator {key [ 0,.01,.02,.03,.04,.05,.06,.07,.08,.09,.10,.11,.12,.13,.14,.15,.16,.17,.18,.19,.20,.21,.22,.23,.24,.25,.26,.27,.28,.29,.30,.31,.32,.33,.34,.35,.36,.37,.38,.39,.40,.41,.42,.43,.44,.45,.46,.47,.48,.49,.50,.51,.52,.53,.54,.55,.56,.57,.58,.59,.60,.61,.62,.63,.64,.65,.66,.67,.68,.69,.70,.71,.72,.73,.74,.75,.76,.77,.78,.79,.80,.81,.82,.83,.84,.85,.86,.87,.88,.89,.90,.91,.92,.93,.94,.95,.96,.97,.98,.99, 1.0]

9 keyValue [ 0 0 -1.5, 8 0 -1.5, 16 0 -1.5, 25 0 -1.5, 32 0 -1.5, 40 0 -1.5, 48 0 -1.5, 56 0 -1.5, 64 0 -1.5, 72 0 -1.5, #.9 80 0 -1.5, 88 0 -1.5, 98.5 0 -1.5, 98.5 0 -9.5, 98.5 0 -17.5, #.12 go north 98.5 0 -25.5, 98.5 0 -33.5, 98.5 0 -41.5, 98.5 0 -45.5, 96 0 -48.5,#.19 96 0 -48.5, 96 0 -48.5, 88 0 -48.5, 78 0 -48.5, 68 0 -48.5, #go west 58 0 -48.5, 48 0 -48.5, 38 0 -48.5, 28 0 -48.5, 18 0 -48.4,#.29 8 0 -48.5, -8 0 -48.5, -18 0 -48.5, -28 0 -48.5, -38 0 -48.5, -48 0 -48.5, -58 0 -48.5, - 68 0 -48.5, -78 0 -48.5, -88 0 -48.5, -96 0 -48.5, -96 0 -48.5, -96 0 -48.5, -98.5 0 -40, -98.5 0 -30, #.43 go south -98.5 0 -20, -98.5 0 -10, -98.5 0 0, -98.5 0 8, -98.5 0 16, #.49 -98.5 0 24, -98.5 0 32, -98.5 0 48, -98.5 0 48, -98.5 0 48, #.52 go to east -88 0 48.5, -80 0 48.5, -72 0 48.5, -64 0 48.5, -56 0 48.5,#.59 -48 0 48.5, -40 0 48.5, -32 0 48.5, -24 0 48.5, -16 0 48.5, -8 0 48.5, 6 0 48.5, 14 0 48.5, 24 0 48.5, 34 0 48.5,44 0 48.5, 54 0 48.5, 64 0 48.5, 74 0 48.5, 84 0 48.5, 96 0 48.5, 96 0 48.5, 96 0 48.5, 98.5 0 40, 98.5 0 32, #.79,.78 go north 98.5 0 24, 98.5 0 16, 98.5 0 8, 98.5 0 -1.5, 90 0 -1.5, #.84 go west 80 0 -1.5, 70 0 -1.5, 60 0 -1.5, 50 0 -1.5, 40 0 -1.5, #.89 30 0 -1.5, 20 0 -1.5, 10 0 -1.5, 0 0 -1.5, -8 0 -1.5, # -8 0 -1.5, -8 0 -1.5, -8 0 -1.5, -8 0 -1.5, -8 0 -1.5, -5 0 -1.5 #1.0 ]}

10 DEF BusRotation OrientationInterpolator {key [ 0,.01,.02,.03,.04,.05,.06,.07,.08,.09,.10,.11,.12,.13,.14,.15,.16,.17,.18,.19,.20,.21,.22,.23,.24,.25,.26,.27,.28,.29,.30,.31,.32,.33,.34,.35,.36,.37,.38,.39,.40,.41,.42,.43,.44,.45,.46,.46,.47,.48,.49,.50,.51,.52,.53,.54,.55,.56,.57,.58,.59,.60,.61,.62,.63,.64,.65,.66,.67,.68,.69,.70,.71,.72,.73,.74,.75,.76,.77,.78,.79,.80,.81,.82,.83,.84,.85,.86,.87,.88,.89,.90,.91,.92,.93,.94,.95,.96,.97,.98,.99, 1.0, 1.01]

11 keyValue [ 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, #.09 0 1 0 0, 0 1 0 0, 0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 1.5708,0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 3.1416, #.19 0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416, 0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,#.29 0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416, 0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,#.39 0 1 0 3.1416,0 1 0 3.1416,0 1 0 3.1416,0 1 0 -1.5708,0 1 0 -1.5708, 0 1 0 -1.5708,0 1 0 -1.5708, 0 1 0 -1.5708, 0 1 0 -1.5708, 0 1 0 -1.5708,#.49 0 1 0 -1.5708,0 1 0 -1.5708, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, #.59 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0,#.69 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 0, 0 1 0 1.5708, 0 1 0 1.5708, #.79 0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 1.5708, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, #.89 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 3.1416, 0 1 0 2.4, 0 1 0 1.5708, 0 1 0 1, 0 1 0.5, 0 1 0 0, 0 1 0 0, 0 1 0 0 # bus turns around ]}

12 ROUTE BusSensor.enterTime TO BusTimer.startTime ROUTE BusTimer.fraction_changed TO BusPosition.set_fraction ROUTE BusTimer.fraction_changed TO BusRotation.set_fraction ROUTE BusPosition.value_changed TO bus1.set_position ROUTE BusRotation.value_changed TO bus1.set_rotation Proximity Sensor Time Sensor Position Interpolator Rotation Interpolator Bus Position Bus Rotation

13 ViewPoint Viewpoint { eventIn SFBool set_bind exposedFieldSFFloatfieldOfView 0.78398 exposedFieldSFBooljumpTRUE exposedFieldSFRotationorientation 0 0 1 0 exposedFieldSFVec3fposition 0 0 10 fieldSFString“ ” eventOutSFTimebindTime eventOutSFBoolisBound

14 ROUTE BusPosition.value_changed TO viewpoint.set_position ROUTE BusRotation.value_changed TO viewpoint.set_orientation PROTO viewpoint [ exposedField SFVec3f position 0 0 0 exposedField SFRotation orientation 0 0 1 0] { Transform {translation 0 1.5 0 children Viewpoint { position IS position orientation IS orientation } } }


Download ppt "Viewpoint and Animation Example: Bus. Sensors DEF BusTimer TimeSensor { cycleInterval 120 loop FALSE} DEF BusSensor ProximitySensor {center 0 1.5."

Similar presentations


Ads by Google