1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
|
3 | <X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'> |
4 | <head> |
5 | <meta name='title' content=' ArbitraryAxisCylinderSensorExamples.x3d '/> |
6 | <meta name='description' content="Modified CylinderSensor oriented about an arbitrary axis, relative to peer/child geometry that remains oriented to its original axis. Select and drag each object to rotate. Originally authored by Don Brutzman's MV4204 class, with modifications by Maj James Breitinger USMC to include min/max angles of rotation and object center. Motivation: Modify example shown by Chapter 9 Figure 7 to build a PROTO for a CylinderSensor oriented about an arbitrary axis."/> |
7 | <meta name=' warning ' content=' ArbitraryAxisCylinderSensor operates on its children, NOT on its peers. This variation is necessary in order to accomplish the desired Transform rotation to a new orientation axis. '/> |
8 | <meta name='creator' content='Don Brutzman'/> |
9 | <meta name='created' content='1 October 1998'/> |
10 | <meta name='modified' content='11 August 2025'/> |
11 |
<meta name='Image' content='ArbitraryAxisCylinderSensorExamples.png'![]() |
12 |
<meta name='Image' content='ArbitraryAxisCylinderSensorExamples.rotated.png'![]() |
13 | <meta name='reference' content=' ArbitraryAxisCylinderSensorPrototype.x3d '/> |
14 | <meta name='reference' content='ArbitraryAxisCylinderSensorExampleOriginal.wrl'/> |
15 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/ArbitraryAxisCylinderSensorExamples.x3d '/> |
16 | <meta name='reference' content='The VRML 2.0 Sourcebook'/> |
17 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
18 | <meta name='license' content='../../license.html'/> |
19 | </head> |
20 | <Scene> |
21 | <WorldInfo title='ArbitraryAxisCylinderSensorExamples.x3d'/> |
22 | <ExternProtoDeclare name='ArbitraryAxisCylinderSensor' appinfo='Modified CylinderSensor with children nodes oriented about an arbitrary axis. Warning: ArbitraryAxisCylinderSensor affects children, not peers.' url=' "../../../Savage/Tools/Animation/ArbitraryAxisCylinderSensorPrototype.x3d#ArbitraryAxisCylinderSensor" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/ArbitraryAxisCylinderSensorPrototype.x3d#ArbitraryAxisCylinderSensor" "../../../Savage/Tools/Animation/ArbitraryAxisCylinderSensorPrototype.wrl#ArbitraryAxisCylinderSensor" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/ArbitraryAxisCylinderSensorPrototype.wrl#ArbitraryAxisCylinderSensor" '> |
23 |
<field name='shiftRotationAxis' type='SFRotation' accessType='initializeOnly'
appinfo='shifted axis of rotation from local vertical, default 1 0 0 0'/> |
24 |
<field name='center' type='SFVec3f' accessType='initializeOnly'
appinfo='local center for axis of rotation, default 0 0 0'/> |
25 |
<field name='showCylinderSensorShape' type='SFBool' accessType='initializeOnly'
appinfo='whether to show visualization shape to show orientation and cylindrical mapping of mouse movements by sensor, default true'/> |
26 |
<field name='scaleCylinderSensorShape' type='SFVec3f' accessType='inputOutput'
appinfo='scale for visualization shape, default 1 1 1'/> |
27 |
<field name='colorCylinderSensorShape' type='SFColor' accessType='inputOutput'
appinfo='color for visualization shape, default 0.9 0.9 0.4'/> |
28 |
<field name='transparencyCylinderSensorShape' type='SFFloat' accessType='inputOutput'
appinfo='transparency for visualization shape'/> |
29 |
<field name='children' type='MFNode' accessType='inputOutput'
appinfo='children nodes affected by ArbitraryAxisCylinderSensor'/> |
30 |
<field name='autoOffset' type='SFBool' accessType='inputOutput'
appinfo='determines whether previous offset values are remembered/accumulated, default true'/> |
31 |
<field name='description' type='SFString' accessType='inputOutput'
appinfo='Text tooltip displayed for user interaction'/> |
32 |
<field name='diskAngle' type='SFFloat' accessType='inputOutput'
appinfo='diskAngle 0 forces disk-like behavior, diskAngle 1.57 (90 degrees) forces cylinder-like behavior, default 0.262, range [0,pi/2]'/> |
33 |
<field name='enabled' type='SFBool' accessType='inputOutput'
appinfo='enables/disables node operation, default true'/> |
34 |
<field name='minAngle' type='SFFloat' accessType='inputOutput'
appinfo='clamps rotation_changed events, default 0, range [-2pi,2pi]'/> |
35 |
<field name='maxAngle' type='SFFloat' accessType='inputOutput'
appinfo='clamps rotation_changed events, default -1, range [-2pi,2pi]'/> |
36 |
<field name='offset' type='SFFloat' accessType='initializeOnly'
appinfo='sends event and remembers last value sensed, default 0, range (-infinity,infinity)'/> |
37 |
<field name='isActive' type='SFBool' accessType='outputOnly'
appinfo='output event isActive=true when primary mouse button is pressed, output event isActive=false when released.'/> |
38 |
<field name='rotation_changed' type='SFRotation' accessType='outputOnly'
appinfo='rotation_changed events equal sum of relative bearing changes plus offset value about Y-axis in local coordinate system'/> |
39 |
<field name='trackPoint_changed' type='SFVec3f' accessType='outputOnly'
appinfo="trackPoint_changed events give intersection point of bearing with sensor's virtual geometry"/> |
40 | </ExternProtoDeclare> |
41 | <Viewpoint description='ArbitraryAxisCylinderSensor Examples'/> |
42 | <Group> |
43 | <!-- Leftmost shape is red with ArbitraryAxisCylinderSensor oriented around X-axis --> |
44 | <Transform DEF='Example1-Cylinder' translation='-3 2 0'> |
45 | <ProtoInstance name='ArbitraryAxisCylinderSensor'> |
46 | <!-- rotate yAxis to xAxis --> |
47 | <fieldValue name='shiftRotationAxis' value='0 0 1 -1.5707963'/> |
48 | <fieldValue name='children'> |
49 | <Shape> |
50 | <Cylinder/> |
51 | <Appearance> |
52 | <Material diffuseColor='1 0 0'/> |
53 | </Appearance> |
54 | </Shape> |
55 | </fieldValue> |
56 | </ProtoInstance> |
57 | </Transform> |
58 | <!-- Middle shape is green with ordinary CylinderSensor oriented around Y-axis --> |
59 | <Group DEF='Example2-Box'> |
60 |
<!-- ROUTE information for MiddleTransformY node:
[from SensorMiddleTransformY.rotation_changed to rotation
]
-->
<Transform DEF='MiddleTransformY' translation='0 2 0'> |
61 | <Shape> |
62 | <Box/> |
63 | <Appearance> |
64 | <Material diffuseColor='0 1 0'/> |
65 | </Appearance> |
66 | </Shape> |
67 |
<!-- ROUTE information for SensorMiddleTransformY node:
[from rotation_changed to MiddleTransformY.rotation
]
-->
<CylinderSensor DEF='SensorMiddleTransformY' description='Select and drag regular CylinderSensor to rotate'/> |
68 | < ROUTE fromNode='SensorMiddleTransformY' fromField='rotation_changed' toNode='MiddleTransformY' toField='rotation'/> |
69 | </Transform> |
70 | </Group> |
71 | <!-- Rightmost shape blue with ArbitraryAxisCylinderSensor oriented around Z-axis --> |
72 | <Transform DEF='Example3-Cone' translation='3 2 0'> |
73 | <ProtoInstance name='ArbitraryAxisCylinderSensor'> |
74 | <!-- rotate yAxis to zAxis --> |
75 | <fieldValue name='shiftRotationAxis' value='1 0 0 1.5707963'/> |
76 | <fieldValue name='children'> |
77 | <Shape> |
78 | <Cone/> |
79 | <Appearance> |
80 | <Material diffuseColor='0 0 1'/> |
81 | </Appearance> |
82 | </Shape> |
83 | </fieldValue> |
84 | </ProtoInstance> |
85 | </Transform> |
86 | <!-- bottom white shape shows use of ArbitraryAxisCylinderSensor center field --> |
87 | <Transform DEF='Example4-Cone' translation='-3.5 -1 0'> |
88 | <ProtoInstance name='ArbitraryAxisCylinderSensor'> |
89 | <!-- rotate yAxis to zAxis --> |
90 | <!-- rotate yAxis halfway to xAxis --> |
91 | <fieldValue name='shiftRotationAxis' value='0 0 1 -0.785'/> |
92 | <fieldValue name='center' value='0 -2 0'/> |
93 | <fieldValue name='showCylinderSensorShape' value='true'/> |
94 | <fieldValue name='scaleCylinderSensorShape' value='1 2 1'/> |
95 | <fieldValue name='colorCylinderSensorShape' value='0.4 0.9 0.9'/> |
96 | <fieldValue name='transparencyCylinderSensorShape' value='0.4'/> |
97 | <fieldValue name='description' value='Select and drag to rotate'/> |
98 | <fieldValue name='children'> |
99 | <Shape> |
100 | <Cone/> |
101 | <Appearance> |
102 | <Material diffuseColor='1 1 1'/> |
103 | </Appearance> |
104 | </Shape> |
105 | </fieldValue> |
106 | </ProtoInstance> |
107 | </Transform> |
108 | <!-- Finally some explanation text. Try setting showIcon to true. --> |
109 | <Transform DEF='Example5-Text' translation='1.8 -1.5 0'> |
110 | <ProtoInstance name='ArbitraryAxisCylinderSensor'> |
111 | <!-- rotate yAxis to zAxis --> |
112 | <!-- rotate yAxis halfway to -xAxis --> |
113 | <fieldValue name='shiftRotationAxis' value='0 0 1 0.785'/> |
114 | <fieldValue name='center' value='0 0 0'/> |
115 | <fieldValue name='showCylinderSensorShape' value='false'/> |
116 | <fieldValue name='scaleCylinderSensorShape' value='0.05 2 0.05'/> |
117 | <fieldValue name='colorCylinderSensorShape' value='1 1 1'/> |
118 | <fieldValue name='transparencyCylinderSensorShape' value='0.9'/> |
119 | <fieldValue name='children'> |
120 | <Shape> |
121 | <Appearance> |
122 | <Material diffuseColor='0 1 1' emissiveColor='0 1 1'/> |
123 | </Appearance> |
124 | <Text string='"ArbitraryAxisCylinderSensor" "Examples"'> |
125 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.6'/> |
126 | </Text> |
127 | </Shape> |
128 | <Shape> |
129 | <Box size='6.4 1.4 0.05'/> |
130 | <Appearance> |
131 | <Material transparency='1'/> |
132 | </Appearance> |
133 | </Shape> |
134 | </fieldValue> |
135 | </ProtoInstance> |
136 | </Transform> |
137 | </Group> |
138 | </Scene> |
139 | </X3D> |
Event Graph ROUTE Table with 1 ROUTE connection 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.
line 45
ProtoInstance ArbitraryAxisCylinderSensor |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declaration with direct access to other nodes, and thus has potential to produce run-time animation. |
line 73
ProtoInstance ArbitraryAxisCylinderSensor |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declaration with direct access to other nodes, and thus has potential to produce run-time animation. |
line 88
ProtoInstance ArbitraryAxisCylinderSensor |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declaration with direct access to other nodes, and thus has potential to produce run-time animation. |
line 110
ProtoInstance ArbitraryAxisCylinderSensor |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
SensorMiddleTransformY
CylinderSensor rotation_changed SFRotation |
MiddleTransformY
Transform rotation SFRotation |
<!--
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)
<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.
-->