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='4 October 2023'/> |
9 | <meta name='description' content='Demonstrate composition of rotation values using X3D-Edit RotationCalculator.'/> |
10 | <meta name='drawing' content='https://savage.nps.edu/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://savage.nps.edu/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 description='Rotation Calculator Example' position='0 0 12'/> |
21 | <Viewpoint description='Left side direct view' position='-3 0 12'/> |
22 | <Viewpoint 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
CubeWithLabeledSides is a DEF node that has 1 USE node: USE_1 -->
<Inline DEF='CubeWithLabeledSides' 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 | </Transform> |
62 | <Transform DEF='RightSide' translation='4 0 0'> |
63 | <!-- Composed equivalent rotation follows, X3D-Edit can reload rotation array values from embedded comment --> |
64 | <Transform DEF='ComposedRotation' rotation='0.87262 0.40202 0.27735 2.24592'> |
65 | <!-- 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 --> |
66 | <Inline USE='CubeWithLabeledSides'/> |
67 | <Shape USE='AxisLinesShape'/> |
68 | </Transform> |
69 | <Transform translation='0 3 0'> |
70 | <Shape> |
71 | <Text string='"Single composed" "Transform rotation"'> |
72 | <FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/> |
73 | </Text> |
74 | <Appearance USE='TextAppearance'/> |
75 | </Shape> |
76 | </Transform> |
77 | <Transform translation='0 -3 0'> |
78 | <Shape> |
79 | <Text string='"computed with X3D-Edit" "Rotation Calculator"'> |
80 | <FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/> |
81 | </Text> |
82 | <Appearance USE='TextAppearance'/> |
83 | </Shape> |
84 | </Transform> |
85 | </Transform> |
86 | </Scene> |
87 | </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)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->