#X3D V3.0 utf8 PROFILE Immersive # [X3D] version=3.0 # [X3D] noNamespaceSchemaLocation=https://www.web3d.org/specifications/x3d-3.0.xsd # X3D-to-ClassicVRML XSL translation autogenerated by X3dToClassicVrmlEncoding.xslt and X3dToVrml97.xslt # https://www.web3d.org/x3d/content/X3dToClassicVrmlEncoding.xslt # https://www.web3d.org/x3d/content/X3dToVrml97.xslt # Transformation using XSLT processor: Saxonica # head META "title" "TimeDelaySensorExample.x3d" META "description" "Time delay sensor design pattern: example use." META "creator" "Don Brutzman and MV4204 class" META "created" "18 August 2003" META "modified" "28 November 2019" META "reference" "TimeDelaySensorPrototype.x3d" META "reference" "https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/time.html" META "reference" "https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/utils.html" META "subject" "TimeDelaySensor" META "identifier" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorExample.x3d" META "generator" "X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit" META "license" "../../license.html" # [Scene] ========== ========== ========== WorldInfo { title "TimeDelaySensorExample.x3d" } EXTERNPROTO TimeDelaySensor [ # [appinfo] TimeSensor functionality commences after delayInterval pause inputOutput SFString description # [appinfo] describe the purpose of this sensor inputOutput SFTime startTime inputOutput SFBool enabled inputOutput SFTime delayInterval # [appinfo] seconds outputOnly SFTime delayCompleteTime initializeOnly SFBool traceEnabled ][ "TimeDelaySensorPrototype.x3d#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor" "TimeDelaySensorPrototype.wrl#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor" ] # ==================== DEF TextTouchGroup Group { children [ Shape { geometry Text { string [ "click text then wait for" "3 second time delay" "before color changes" ] fontStyle FontStyle { justify [ "MIDDLE" "MIDDLE" ] } } appearance Appearance { material DEF TextColor Material { } } } DEF TouchSensorActive TouchSensor { description "click to initiate time delay and color change" } ] } # ==================== DEF TextAnimationGroup Group { children [ DEF DelayTimer TimeDelaySensor { delayInterval 3 traceEnabled TRUE } DEF AnimationClock TimeSensor { cycleInterval 2 } DEF ColorChangerRGB ColorInterpolator { key [ 0 0.5 1 ] keyValue [ 1 0 0 0 1 0 0 0 1 ] } ] ROUTE TouchSensorActive.touchTime TO DelayTimer.set_startTime ROUTE DelayTimer.delayCompleteTime TO AnimationClock.set_startTime ROUTE AnimationClock.fraction_changed TO ColorChangerRGB.set_fraction ROUTE ColorChangerRGB.value_changed TO TextColor.diffuseColor }