Skip to content

Instantly share code, notes, and snippets.

@andreasplesch
Last active March 21, 2019 15:23
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/0d59b7c769565b0e2d1880562fbff1b0 to your computer and use it in GitHub Desktop.
Save andreasplesch/0d59b7c769565b0e2d1880562fbff1b0 to your computer and use it in GitHub Desktop.
PlaneSensor axisRotation test 3
<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>PlaneSensor axisRotation</title>
</head>
<body>
<h1>PlaneSensor non-default axisRotation example</h1>
<div id="content">
<x3d width='800px' height='400px'>
<scene>
<inline url='PlaneSensorAxisRotation3.x3d'></inline>
</scene>
</x3d>
</div>
</body>
<?xml version="1.0" encoding="UTF-8"?>
<X3D>
<Scene>
<Viewpoint position='0 0 5' orientation='0 0 1 0' />
<Background skyColor='0.4 0.4 0.4'/>
<Transform DEF='G1'>
<Group DEF='trackpointCursor'>
<Shape>
<Appearance><Material emissiveColor='1 1 0'/></Appearance>
<Sphere radius='.03'/>
</Shape>
</Group>
</Transform>
<Transform translation='-2 1 0'>
<Shape DEF='pad'>
<Appearance><Material diffuseColor='0.7 0.2 0.2'></Material></Appearance>
<Box size='1.5 1.5 .01'/>
</Shape>
<PlaneSensor DEF='PS1' minPosition='-1 0' maxPosition='1 0' axisRotation='0 1 0 1.57'/>
<ROUTE fromNode='PS1' fromField='translation_changed' toNode='G1' toField='translation' />
</Transform>
<Transform translation='0 1 0'>
<Shape DEF='pad2'>
<Appearance><Material diffuseColor='0.7 0.2 0.2'></Material></Appearance>
<Box size='1.5 1.5 .01'/>
</Shape>
<PlaneSensor minPosition='-1 0' maxPosition='1 0' DEF='PS2'/>
<ROUTE fromNode='PS2' fromField='translation_changed' toNode='G1' toField='translation' />
</Transform>
<Transform translation='2 1 0' rotation='0 0 1 -0.78'>
<Transform rotation='0 0 1 0.78'>
<Shape DEF='pad3'>
<Appearance><Material diffuseColor='0.7 0.2 0.2'></Material></Appearance>
<Box size='1.5 1.5 .01'/>
</Shape>
</Transform>
<PlaneSensor minPosition='-1 0' maxPosition='1 0' DEF='PS3' />
<ROUTE fromNode='PS3' fromField='translation_changed' toNode='G1' toField='translation' />
</Transform>
<Transform translation='0 -1 0' rotation='0 0 1 -0.78'>
<Transform DEF='G2'>
<Group USE='trackpointCursor'/>
</Transform>
<Transform rotation='0 0 1 0.78'>
<Shape DEF='pad4'>
<Appearance><Material diffuseColor='0.7 0.2 0.2'></Material></Appearance>
<Box size='1.5 1.5 .01'/>
</Shape>
</Transform>
<PlaneSensor minPosition='-1 0' maxPosition='1 0' DEF='PS4' />
<ROUTE fromNode='PS4' fromField='translation_changed' toNode='G2' toField='translation' />
</Transform>
</Scene>
</X3D>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment