
AccelTransform
Type
ParentNode.
Description
A modified Transform node to change its position according to 3d accelerometer data. Can also move the camera accordingly, and it outputs the event 'translation_changed', to be routed to other nodes. Shares the same attributes as Transform, plus the following:
Attributes
xAccel SFFloat (input) The x-axis acceleration, used to modify the node's translation.
yAccel SFFloat (input) The y-axis acceleration, used to modify the node's translation.
zAccel SFFloat (input) The z-axis acceleration, used to modify the node's translation.
moveCamera SFBoolean (input) If true, the camera is moved when the node's translation is changed.
translation_changed SFVec3f (output) The current (updated) translation value.
Example Use
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE X3D> <X3D profile="Full"> <Scene> <NavigationInfo type="ANY"/> <Background skyColor="1 1 1 0.66 0.66 1" skyAngle="0 1" groundColor="0.125 0.5 0.125 0.5 0.75 0.4 1 1 1" groundAngle="0 1.3 1.570796327"/> <AccelTransform DEF="bob" moveCamera="true"> <Transform translation="0.0 0.0 -8.0 "> <Shape> <Appearance> <Material DEF="boxColour" diffuseColor="1.0 0.0 0.0 "/> </Appearance> <Box/> </Shape> </Transform> </AccelTransform> <Transform translation="-2 0 -10"> <Shape> <Appearance> <Material DEF="boxColour" diffuseColor="0 0 1"/> </Appearance> <Box/> </Shape> </Transform> <Transform translation="2 1 -10"> <Shape> <Appearance> <Material DEF="boxColour" diffuseColor="0.1 0.8 0.1"/> </Appearance> <Box/> </Shape> </Transform> </Scene> </X3D>