| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
| 3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
| 4 | <head> |
| 5 | <meta name='title' content=' RotationCalculatorExample.x3d '/> |
| 6 | <meta name='creator' content='Don Brutzman'/> |
| 7 | <meta name='created' content='30 December 2015'/> |
| 8 | <meta name='modified' content='30 August 2025'/> |
| 9 | <meta name='description' content='Demonstrate composition of rotation values using X3D-Edit RotationCalculator, select and hold either side to compare direct straight-ahead views without parallax.'/> |
| 10 | <meta name='drawing' content='https://www.web3d.org/x3d/tools/X3D-Edit/images/RotationCalculator.png'/> |
| 11 | <meta name='reference' content='../HumanoidAnimation/RotationTests.x3d'/> |
| 12 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Animation/RotationCalculatorExample.x3d '/> |
| 13 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 14 | <meta name='license' content='../license.html'/> |
| 15 | </head> |
| 16 | <Scene> |
| 17 | <WorldInfo title='RotationCalculatorExample.x3d'/> |
| 18 | <Background skyColor='0.8 0.8 0.9'/> |
| 19 | <NavigationInfo/> |
| 20 | <Viewpoint DEF='ViewCenter' description='Rotation Calculator Example' position='0 0 12'/> |
| 21 |
<!-- ROUTE information for ViewLeft node:
[from TouchLeftCube.isActive to set_bind
]
-->
<Viewpoint DEF='ViewLeft' description='Left side direct view' position='-3 0 12'/> |
| 22 |
<!-- ROUTE information for ViewRight node:
[from TouchRightCube.isActive to set_bind
]
-->
<Viewpoint DEF='ViewRight' description='Right side direct view' position='3 0 12'/> |
| 23 | <Transform DEF='LeftSide' translation='-4 0 0'> |
| 24 | <!-- Individual nested rotations follow --> |
| 25 | <Transform DEF='OuterRotationXaxis135degrees' rotation='1 0 0 2.356194'> |
| 26 | <Transform DEF='CenterRotationYaxis45Degrees' rotation='0 1 0 0.785398'> |
| 27 | <Transform DEF='InnerRotationZaxis-30degrees' rotation='0 0 1 -0.523599'> |
| 28 | <Inline DEF='CubeWithLabeledSides1' url=' "../GeometricShapes/CubeWithLabeledSides.x3d" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/CubeWithLabeledSides.x3d" "../GeometricShapes/CubeWithLabeledSides.wrl" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/CubeWithLabeledSides.wrl" '> |
| 29 | <MetadataString name='profile' value='"Interchange"'/> |
| 30 | </Inline> |
| 31 |
<!-- Shape
AxisLinesShape is a DEF node that has 1 USE node: USE_1 -->
<Shape DEF='AxisLinesShape'> |
| 32 | <IndexedLineSet colorPerVertex='false' colorIndex='0 1 2' coordIndex='0 1 -1 0 2 -1 0 3 -1'> |
| 33 | <Coordinate point='0 0 0 1.78 0 0 0 1.78 0 0 0 1.78'/> |
| 34 | <Color color='1 0 0 0 0.6 0 0 0 1'/> |
| 35 | </IndexedLineSet> |
| 36 | <Appearance> |
| 37 | <Material diffuseColor='0.9 0.9 0.9'/> |
| 38 | </Appearance> |
| 39 | </Shape> |
| 40 | </Transform> |
| 41 | </Transform> |
| 42 | </Transform> |
| 43 | <Transform translation='0 3 0'> |
| 44 | <Shape> |
| 45 | <Text string='"Multiple single-axis" "Transform rotations"'> |
| 46 | <FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/> |
| 47 | </Text> |
| 48 |
<!-- Appearance
TextAppearance is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
<Appearance DEF='TextAppearance'> |
| 49 | <Material diffuseColor='0.1 0.2 0.9'/> |
| 50 | </Appearance> |
| 51 | </Shape> |
| 52 | </Transform> |
| 53 | <Transform translation='0 -3 0'> |
| 54 | <Shape> |
| 55 | <Text string='"using multiple" "nested Transform nodes"'> |
| 56 | <FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/> |
| 57 | </Text> |
| 58 | <Appearance USE='TextAppearance'/> |
| 59 | </Shape> |
| 60 | </Transform> |
| 61 | <Shape DEF='TransparentBacking1'> |
| 62 | <Box size='7 7 0.1'/> |
| 63 |
<!-- Appearance
TransparentAppearance is a DEF node that has 1 USE node: USE_1 -->
<Appearance DEF='TransparentAppearance'> |
| 64 | <Material transparency='1'/> |
| 65 | </Appearance> |
| 66 | </Shape> |
| 67 |
<!-- ROUTE information for TouchLeftCube node:
[from isActive to ViewLeft.set_bind
]
-->
<TouchSensor DEF='TouchLeftCube' description='Hold for direct left-side view, no parallax'/> |
| 68 | < ROUTE fromNode='TouchLeftCube' fromField='isActive' toNode='ViewLeft' toField='set_bind'/> |
| 69 | </Transform> |
| 70 | <Transform DEF='RightSide' translation='4 0 0'> |
| 71 | <!-- Composed equivalent rotation follows, X3D-Edit can reload rotation array values from embedded comment --> |
| 72 | <Transform DEF='ComposedRotation' rotation='0.87262 0.40202 0.27735 2.24592'> |
| 73 | <!-- RotationCalculator composed rotation: 1.0 0.0 0.0 2.35619, 0.0 1.0 0.0 0.785398, 0.0 0.0 1.0 -0.523599 --> |
| 74 | <!-- Can't re-use USE node for independent TouchSensor selection <Inline USE='CubeWithLabeledSides'/> --> |
| 75 | <Inline DEF='CubeWithLabeledSides2' url=' "../GeometricShapes/CubeWithLabeledSides.x3d" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/CubeWithLabeledSides.x3d" "../GeometricShapes/CubeWithLabeledSides.wrl" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/CubeWithLabeledSides.wrl" '> |
| 76 | <MetadataString name='profile' value='"Interchange"'/> |
| 77 | </Inline> |
| 78 | <Shape USE='AxisLinesShape'/> |
| 79 | </Transform> |
| 80 | <Transform translation='0 3 0'> |
| 81 | <Shape> |
| 82 | <Text string='"Single composed" "Transform rotation"'> |
| 83 | <FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/> |
| 84 | </Text> |
| 85 | <Appearance USE='TextAppearance'/> |
| 86 | </Shape> |
| 87 | </Transform> |
| 88 | <Transform translation='0 -3 0'> |
| 89 | <Shape> |
| 90 | <Text string='"computed with X3D-Edit" "Rotation Calculator"'> |
| 91 | <FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/> |
| 92 | </Text> |
| 93 | <Appearance USE='TextAppearance'/> |
| 94 | </Shape> |
| 95 | </Transform> |
| 96 | <Shape DEF='TransparentBacking2'> |
| 97 | <Box size='7 7 0.1'/> |
| 98 | <Appearance USE='TransparentAppearance'/> |
| 99 | </Shape> |
| 100 |
<!-- ROUTE information for TouchRightCube node:
[from isActive to ViewRight.set_bind
]
-->
<TouchSensor DEF='TouchRightCube' description='Hold for direct right-side view, no parallax'/> |
| 101 | < ROUTE fromNode='TouchRightCube' fromField='isActive' toNode='ViewRight' toField='set_bind'/> |
| 102 | </Transform> |
| 103 | </Scene> |
| 104 | </X3D> |
Event Graph ROUTE Table entries with 2 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.
|
TouchLeftCube
TouchSensor isActive SFBool |
ViewLeft
Viewpoint set_bind SFBool |
|
TouchRightCube
TouchSensor isActive SFBool |
ViewRight
Viewpoint set_bind SFBool |
<!--
Color-coding 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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->