<?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 e = 5; var f = 5; var g = 5; var h = 5; var resolution = 100; function initialize() { generateCoordinates(); var localci = []; for (var i = 0; i < resolution-1; i++) { for (var j = 0; j < resolution-1; j++) { localci.push(i*resolution+j); localci.push(i*resolution+j+1); localci.push((i+1)*resolution+j+1); localci.push((i+1)*resolution+j); localci.push(-1); } } coordIndexes = new MFInt32(localci); } function generateCoordinates() { var theta = 0.0; var phi = 0.0; var delta = (2 * 3.141592653) / (resolution-1); var localc = []; for (var i = 0; i < resolution; i++) { for (var j = 0; j < resolution; j++) { var rho = e + f * Math.cos(g * theta) * Math.cos(h * phi); localc.push(new SFVec3f( rho * Math.cos(phi) * Math.cos(theta), rho * Math.cos(phi) * Math.sin(theta), rho * Math.sin(phi) )); theta += delta; } phi += delta; } coordinates = new MFVec3f(localc); } function set_fraction(fraction, eventTime) { var choice = Math.floor(Math.random() * 4); switch (choice) { case 0: e += Math.floor(Math.random() * 2) * 2 - 1; break; case 1: f += Math.floor(Math.random() * 2) * 2 - 1; break; case 2: g += Math.floor(Math.random() * 2) * 2 - 1; break; case 3: h += Math.floor(Math.random() * 2) * 2 - 1; break; } if (e < 1) { f = 10; } if (f < 1) { f = 10; } if (g < 1) { g = 4; } if (h < 1) { h = 4; } generateCoordinates(); }
]]>
Event Graph ROUTE Table entries with 5 ROUTE connections total, showing event model relationships for this scene.
Clock
TimeSensor fraction_changed SFFloat |
OrbitScript
Script set_fraction SFFloat |
then |
OrbitScript
Script coordinates MFVec3f |
OrbitCoordinates
Coordinate point MFVec3f |
||
then |
OrbitScript
Script coordIndexes MFInt32 |
Orbit
IndexedFaceSet set_coordIndex MFInt32 |
||||
Clock
TimeSensor fraction_changed SFFloat |
OrbitPath
OrientationInterpolator set_fraction SFFloat |
then |
OrbitPath
OrientationInterpolator value_changed SFRotation |
OrbitTransform
Transform rotation SFRotation |
ProtoInstance |
(No ROUTE connection found for this node) |
ProtoInstance |
(No ROUTE connection found for this node) |
<!--
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. -->