<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<![CDATA[
ecmascript: var maxValue; function initialize() { maxValue = 0; } function setTextValues(values, timeEvent) { var precision = 2; RangeText.string[0] ='Range ' + roundOff(values[0], precision); if(values[1] > maxValue) { maxValue = roundOff(values[1], precision); Browser.println ('maximum' + maxValue); } Browser.println ('values' + values[1]); HeightText.string[0] ='Max Height ' + maxValue; } function reset(bool, eventTime) { maxValue = 0; } //A function to round the values regarding to given precision. function roundOff(value, precision) { var result; var isNegative = false; var wholeInt = Math.round(value * Math.pow(10, precision)); //Negative numbers creates exceptional condition, therefor they are converted //to positive values. if(wholeInt < 0) { wholeInt = -wholeInt; isNegative = true; } var whole = wholeInt.toString(); var decPoint = whole.length - precision; //Exception when precision is bigger than the string length if(decPoint < 0) { i = -decPoint; for(i; i > 0; i--) { whole ='0' + whole; } //Calculate decPoint according to new string expanded with 0s decPoint = whole.length - precision; } if(whole !='0') { //Put the decimal point on the appropriate place result = whole.substring(0, decPoint); result +='.'; result += whole.substring(decPoint, whole.length); } else { //If the string is'0', then result is'0' result = whole; } //Negative numbers are altered. if(isNegative) { result ='-' + result; } //Convert the String value to Float. resultFloat = parseFloat(result); return resultFloat; }
]]>
<![CDATA[
ecmascript: function initialize() { } function setTime(inputTime, timeEvent) { TimerNode.cycleInterval = inputTime; }
]]>
Event Graph ROUTE Table entries with 11 ROUTE connections total, showing X3D event-model relationships for this scene.
Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.
HitSensor
TouchSensor touchTime SFTime |
Timer
TimeSensor set_startTime SFTime |
then |
Timer
TimeSensor fraction_changed SFFloat |
ProjectileInterpolator
ProtoInstance set_fraction SFFloat |
then |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
ValueDisplayer
Script setTextValues SFVec3f |
|||
then |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
BallTransform
Transform set_translation SFVec3f |
||||||||
HitSensor
TouchSensor isActive SFBool |
ValueDisplayer
Script reset SFBool |
TimeConverter
Script |
No ROUTE connection found for output from this node. Contains SFNode field with indirect access to another node. |
ValueDisplayer
Script |
No ROUTE connection found for output from this node. Contains SFNode field with indirect access to another node. |
HudProx
ProximitySensor position_changed SFVec3f |
HudTransform
Transform set_translation SFVec3f |
|
HudProx
ProximitySensor orientation_changed SFRotation |
HudTransform
Transform set_rotation SFRotation |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
ValueDisplayer
Script setTextValues SFVec3f |
|
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
BallTransform
Transform set_translation SFVec3f |
SliderAngle
ProtoInstance currentValueFloat SFFloat |
ProjectileInterpolator
ProtoInstance set_theta SFFloat |
then |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
ValueDisplayer
Script setTextValues SFVec3f |
||
then |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
BallTransform
Transform set_translation SFVec3f |
SliderVelocity
ProtoInstance currentValueFloat SFFloat |
ProjectileInterpolator
ProtoInstance set_Vi SFFloat |
then |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
ValueDisplayer
Script setTextValues SFVec3f |
||
then |
ProjectileInterpolator
ProtoInstance value_changed SFVec3f |
BallTransform
Transform set_translation SFVec3f |
TimeCycle
ProtoInstance currentValueFloat SFFloat |
TimeConverter
Script setTime SFFloat |
<!--
Online at
https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/ProjectileInterpolatorArenaIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/StudentProjects/ProjectileInterpolatorArena.x3d
-->
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->