<!-- Click and drag to rotate shapes. Superfluous Group nodes removed. -->
<!-- First rotate to reorient the first CylinderSensor -->
<
Transform rotation='
1 0 0 1.57'
translation='
-2 0 0'>
<!--
FIRST_CYLINDERSENSOR ROUTE:
[
from rotation_changed to FIRST_TRANSFORM.set_rotation
]
-->
<
CylinderSensor DEF='
FIRST_CYLINDERSENSOR'
description='
Click and drag to rotate'
maxAngle='
1.57'
minAngle='
-0.78'/>
<!--
FIRST_TRANSFORM ROUTE:
[
from FIRST_CYLINDERSENSOR.rotation_changed to set_rotation
]
-->
<
Transform DEF='
FIRST_TRANSFORM'>
<!-- Note that we are connecting a rotation output to a rotation input in these ROUTEs. -->
<
ROUTE fromNode='
FIRST_CYLINDERSENSOR'
fromField='
rotation_changed'
toNode='
FIRST_TRANSFORM'
toField='
set_rotation'/>
<!-- Keep transparent user-interface geometry in this rotated CylinderSensor coordinate frame -->
<
Transform DEF='
TRANSPARENT_CYLINDER_TRANSFORM'>
<
Shape>
<
Cylinder height='
.5'/>
<
Appearance>
<Material diffuseColor='.7 .7 .7' transparency='.5'/>
</
Appearance>
</
Shape>
</
Transform>
<!-- Now restore original Y=up coordinate frame prior to drawing actual geometry -->
<
Transform rotation='
1 0 0 -1.57'>
<
Shape>
<
Box size='
1 3 1'/>
<
Appearance DEF='
FIRST_APPEARANCE'>
<Material diffuseColor='.9 .9 .1' emissiveColor='.2 .2 .05'/>
</
Appearance>
</
Shape>
</
Transform>
</
Transform>
</
Transform>
<!-- Note this second example uses a simpler pattern: since we are not rotating the axis of the CylinderSensor away from the vertical, we do not need to change that rotation back again for the target geometry. -->
<!--
SECOND_TRANSFORM ROUTE:
[
from SECOND_CYLINDERSENSOR.rotation_changed to set_rotation
]
-->
<
Transform DEF='
SECOND_TRANSFORM'
translation='
2 0 0'>
</
Transform>