[X3D-Public] Any way to do a 'LineSensor' (Like PlaneSensor but in one dimension)

Keith Victor keithrvictor at gmail.com
Fri Sep 24 11:04:04 PDT 2010


Hey:

This is  a long thread, Im not sure if its answered.

Heres some more input:

The Plane Sensor was made to opperate in the X-Y plane.  If thats what
you want, you can specify the min/max X and Y values, and all is good.

If you want to work in a Plane that has the Z axis, it gets a bit
hairy.  You have to transform the things, then, apply the inverse
transform.

Vivaty Studio will do it all for you!  Just select the object, and do:
Interaction / Drag Selected Node.  The GUI pops up, and you can select
which plane you wish the sensor to opperate in, and and Min and Max
values for that plane.  It will generate the X3D ( without script )
that does the transform, and inverse transform.
I pasted the output below for a Line Sensor that translates along the Z axis,

I dont know if this helped or not.


Keith Victor



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"
"http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' >
<head>
 <meta name='ExportTime' content='13:59:59'/>
 <meta name='ExportDate' content='9/24/2010'/>
 <meta name='VivatyStudioVersion' content='740'/>
</head>
<Scene>
<Transform DEF='dad_DragWizardGroup'
 rotation='.577 .577 .577 2.094'>
 <Group DEF='DragWizardGroup'
  containerField='children'>
  <Transform DEF='dad_DragWizardGroupAlign'
   containerField='children'>
   <Transform DEF='dad_DragWizGrp'
    containerField='children'
    rotation='-.577 -.577 -.577 2.094'>
    <Shape DEF='Box1'
     containerField='children'>
     <Appearance
      containerField='appearance'>
      <Material DEF='Red'
       containerField='material'
       ambientIntensity='.2'
       shininess='.2'
       diffuseColor='1 0 0'/>
     </Appearance>
     <Box DEF='GeoBox1'
      containerField='geometry'
      size='1 1 1'/>
    </Shape>
   </Transform>
  </Transform>
  <PlaneSensor DEF='DragWizardSensor'
   containerField='children'
   minPosition='0 -5'
   maxPosition='0 5'/>
 </Group>
</Transform>
<Transform DEF='dad_Cone2'
 translation='3.22596 0 -4.64446'>
 <Shape DEF='Cone2'
  containerField='children'>
  <Appearance
   containerField='appearance'>
   <Material
    containerField='material'
    USE='Red'/>
  </Appearance>
  <Cone DEF='GeoCone2'
   containerField='geometry'
   height='2'
   bottomRadius='1'/>
 </Shape>
</Transform>
<Transform DEF='dad_Cone1'
 translation='-3.54626 0 .02288'>
 <Shape DEF='Cone1'
  containerField='children'>
  <Appearance
   containerField='appearance'>
   <Material
    containerField='material'
    USE='Red'/>
  </Appearance>
  <Cone DEF='GeoCone1'
   containerField='geometry'
   height='2'
   bottomRadius='1'/>
 </Shape>
</Transform>
<ROUTE fromNode='DragWizardSensor' fromField='translation_changed'
toNode='dad_DragWizardGroupAlign' toField='set_translation'/>
</Scene>
</X3D>



More information about the X3D-Public mailing list