[X3D-Public] Model Building for Light Simulation

Don Brutzman brutzman at nps.edu
Tue Aug 13 17:34:02 PDT 2013

On 8/13/2013 4:05 PM, Len Bullard wrote:
> Question:
> What is the best configuration of systems for building a light data-driven
> waypoint simulation in X3D that uses the Monterey tool kits as the editing
> suite?

Please see Savage examples archive
	Waypoint Interpolator Example




This is also available as a drag-and-drop palette item in X3D-Edit 
(listed under Savage examples)


which produces the following code snippet.  looks gnarly until you play 
with it, have just added lots of switches and options over time. 
reading appinfo helps.

Good way to produce a data-driven visualization:
- produce some positional data
- wrap the excerpt around it
- view

         <!-- ==================== -->
         <ExternProtoDeclare appinfo='Reads waypoints and 
legSpeeds/legDurations/defaultSpeed to provide a customizable 
position/orientation interpolator.' name='WaypointInterpolator' 
           <!-- Priority of use: legSpeeds (m/sec), legDurations 
(seconds), defaultSpeed (m/sec) -->
           <field accessType='initializeOnly' appinfo='Short description 
of what is animated by this WaypointInterpolator.' name='description' 
           <field accessType='initializeOnly' appinfo='Waypoints being 
traversed with interpolation of intermediate positions and 
orientations.' name='waypoints' type='MFVec3f'/>
           <field accessType='inputOnly' appinfo='Add another single 
waypoint to array of waypoints recalculate interpolator values.' 
name='add_waypoint' type='SFVec3f'/>
           <field accessType='inputOnly' appinfo='Replace all waypoints 
recalculate interpolator values.' name='set_waypoints' type='MFVec3f'/>
           <field accessType='initializeOnly' appinfo='Whether to pitch 
child geometry (such as a vehicle) up or down to match vertical slope' 
name='pitchUpDownForVerticalWaypoints' type='SFBool'/>
           <field accessType='initializeOnly' appinfo='Units m/sec. If 
used array lengths for legSpeeds and legDurations must be one less than 
number of waypoints.' name='legSpeeds' type='MFFloat'/>
           <field accessType='initializeOnly' appinfo='Units in seconds. 
If used array lengths for legSpeeds and legDurations must be one less 
than number of waypoints.' name='legDurations' type='MFTime'/>
           <field accessType='initializeOnly' appinfo='Units m/sec.' 
name='defaultSpeed' type='SFFloat'/>
           <field accessType='initializeOnly' appinfo='turningRate 
(degrees/second) also determines standoff distance prior to waypoint 
where turn commences. If 0 turns are instantaneous.' name='turningRate' 
           <field accessType='outputOnly' appinfo='Output calculation 
summing all leg durations, useful for setting TimeSensor cycleInterval. 
Units in seconds.' name='totalDuration' type='SFTime'/>
           <!-- interpolation fields -->
           <field accessType='inputOnly' appinfo='exposed 
PositionInterpolator and OrientationInterpolator setting' 
name='set_fraction' type='SFFloat'/>
           <field accessType='outputOnly' appinfo='exposed 
PositionInterpolator setting' name='position_changed' type='SFVec3f'/>
           <field accessType='outputOnly' appinfo='exposed 
OrientationInterpolator setting' name='orientation_changed' 
           <!-- display-related fields -->
           <field accessType='inputOutput' appinfo='default color for 
non-active line segments' name='lineColor' type='SFColor'/>
           <field accessType='inputOutput' 
appinfo='highlightSegmentColors must contain two color values for each 
endpoint of the highlight segment.' name='highlightSegmentColor' 
           <field accessType='inputOutput' appinfo='1.0 is completely 
transparent, 0.0 is completely opaque.' name='transparency' type='SFFloat'/>
           <field accessType='initializeOnly' appinfo='allowed values: 
none; waypoints (produce labels at each waypoint); or interpolation 
(produce single moving label at interpolator time course speed 
location)' name='labelDisplayMode' type='SFString'/>
           <field accessType='initializeOnly' appinfo='allowed values: 
altitude depth (negate Y value) none' name='heightLabel' type='SFString'/>
           <field accessType='initializeOnly' appinfo='heightLabel 
relative location' name='labelOffset' type='SFVec3f'/>
           <field accessType='initializeOnly' appinfo='heightLabel text 
size' name='labelFontSize' type='SFFloat'/>
           <field accessType='initializeOnly' appinfo='heightLabel text 
color' name='labelColor' type='SFColor'/>
           <field accessType='initializeOnly' appinfo='enable console 
output to trace script computations and prototype progress' 
name='traceEnabled' type='SFBool'/>
           <field accessType='initializeOnly' appinfo='Output the number 
of waypoints totalDistance and totalDuration to console upon 
initialization' name='outputInitializationComputations' type='SFBool'/>
           <field accessType='inputOutput' appinfo='default color for 
vertical drop-line segments' name='verticalDropLineColor' type='SFColor'/>
           <field accessType='inputOutput' appinfo='1.0 is completely 
transparent 0.0 is completely opaque.' 
name='verticalDropLineTransparency' type='SFFloat'/>
     <!-- Only one copy of a given ExternProtoDeclare is needed in a 
scene. Multiple ProtoInstance nodes can be created like the following -->
      <ProtoInstance DEF='WaypointInterpolatorExample' 
           <fieldValue name='description' value='TrackBuilder'/>
           <!-- Priority of use: legSpeeds (m/sec), legDurations 
(seconds), defaultSpeed (m/sec) -->
           <fieldValue name='waypoints' value='-5 0 0 5 2 0 5 5 -10 4.9 
2 -10 -5 0 -10 -5 0 0 -5.5 0 1.5 -7 0.5 2 -8 0 0 -5 0 0'/>
           <fieldValue name='pitchUpDownForVerticalWaypoints' 
           <fieldValue name='legDurations' value='1 2 3 1 2 3 1 2 3'/>
           <fieldValue name='legSpeeds' value='2 4 2 2 4 1 1 1 1'/>
           <fieldValue name='defaultSpeed' value='5'/>
           <fieldValue name='turningRate' value='90'/>
           <fieldValue name='lineColor' value='1 0 0'/>
           <fieldValue name='highlightSegmentColor' value='0.2 0.2 1'/>
           <fieldValue name='transparency' value='0'/>
           <fieldValue name='labelDisplayMode' value='interpolation'/>
           <fieldValue name='heightLabel' value='altitude'/>
           <fieldValue name='labelOffset' value='0 1.2 0'/>
           <fieldValue name='labelFontSize' value='0.5'/>
           <fieldValue name='labelColor' value='0.3 0.9 0.3'/>
           <fieldValue name='traceEnabled' value='false'/>
           <fieldValue name='outputInitializationComputations' 
      <!-- Example use: 
      <!-- ==================== -->

all the best, Don
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

More information about the X3D-Public mailing list