Skip to content

Instantly share code, notes, and snippets.

@andreasplesch
Last active December 3, 2017 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasplesch/34d6c24972d37a0ad9e2070cf3a8a2c6 to your computer and use it in GitHub Desktop.
Save andreasplesch/34d6c24972d37a0ad9e2070cf3a8a2c6 to your computer and use it in GitHub Desktop.
CyclinderSensor axisRotation test
<?xml version="1.0" encoding="UTF-8"?>
<X3D profile='Immersive' version='3.2' >
<Scene>
<Background groundAngle='1.309 1.570796' groundColor='0 0.3 1 0 0.3 1 0 0.3 1' skyAngle='1.309 1.571' skyColor='0 0.2 0.7 0 0.5 1 1 1 1'/>
<Transform DEF='GlobalAxisLines'>
<Shape>
<Appearance>
<Material DEF='COLOR1' diffuseColor='0.01 0.01 0.1' emissiveColor='0.01 0.01 0.1'/>
</Appearance>
<IndexedLineSet coordIndex='0 1 -1 2 3 -1 4 5 -1 6 7 -1 8 9 -1 10 11 -1'>
<Coordinate point='3.5 0 0 2 0 0 -3.5 0 0 -2 0 0 0 2.5 0 0 2 0 0 -2.5 0 0 -2 0 0 0 3.5 0 0 2 0 0 -3.5 0 0 -2'/>
</IndexedLineSet>
</Shape>
</Transform>
<Group >
<CylinderSensor DEF='ROLL_SENSOR' axisRotation='0 0 1 1.5707963' description='drag gimbal to change roll'/>
<Transform DEF='trackpointA'>
<Group DEF='trackpointCursor'>
<Shape>
<Appearance><Material emissiveColor='1 0 1'/></Appearance>
<Sphere radius='.1'/>
</Shape>
</Group>
</Transform>
<Transform DEF='RollGimbalShape' translation='0 -1.5 0'>
<Shape>
<Appearance><Material diffuseColor='.4 .2 .1'/> </Appearance>
<Cylinder radius='.5'/>
</Shape>
</Transform>
</Group>
<Transform DEF='RollGimbal' >
<Transform translation='0 1.5 0'>
<Shape>
<Appearance><Material diffuseColor='.1 .4 .6'/> </Appearance>
<Box />
</Shape>
</Transform>
</Transform>
<ROUTE fromField='rotation_changed' fromNode='ROLL_SENSOR' toField='set_rotation' toNode='RollGimbal'/>
<ROUTE fromNode='ROLL_SENSOR' fromField='trackPoint_changed' toNode='trackpointA' toField='translation' />
</Scene>
</X3D>
<html><head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="https://www.x3dom.org/download/dev/x3dom-full.debug.js"> </script>
<link rel="stylesheet" type="text/css" href="https://www.x3dom.org/download/dev/x3dom.css">
<title>CylinderSensor axisRotation</title>
</head>
<body>
<h1>CylinderSensor non-default axisRotation Example</h1>
<div id="content">
<x3d width='500px' height='400px'>
<scene>
<inline url='CylinderSensorCylinderAxisRotation90.x3d'></inline>
</scene>
</x3d>
</div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment