<div>Hey Don:</div>
<div> </div>
<div>I agree that an orientation_changed output field would be helpfull in addition to the raw acceleration data.  For true 3D orientation, you would also need compass input along with the accelerometer.  Or, is this the 2D orienation, as I had described.  We need to clearly define this.</div>

<div> </div>
<div>In an ideal world, you can integrate acceleration to get relative velocity.  And, once again to get relative position.  But, Im afraid thats not going to work with these simple devices.  The acceleration of gravity is so much stronger than anything else going on, that the only thing it is good for is detecting the orientation of the device ( which way is down ), and any extreme shaking.  You&#39;re not going to get any good velocity data out of an iPhone ;(</div>

<div> </div>
<div>What is the &quot;IsActive&quot; output field do?  Does that tell you if the device supports this feature.  If its enabled, and working, its going to be active.</div>
<div>Perhaps SFBool isSupported   is a better name.</div>
<div> </div>
<div>Keith</div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Wed, Nov 18, 2009 at 12:53 PM, Don Brutzman <span dir="ltr">&lt;<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">Keith Victor wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hey Don:<br> I think it might look like this:<br> SFBool   InputOutput   enabled    // typical Sensor Node field<br>
SFVec3f    outputOnly    acceleration_changed    // the acceleration vector, in Gs.<br> Simple enough?<br></blockquote><br></div>thanks Keith.  so far so good... 
<div class="im"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">One simple example usage:<br>Then just Route that into a Script, do an atan2( accel.y, accel.x ) to get an angle.<br>
SetOrientation(  0,0,1, atan2( ... ) )<br> Set the orientation of a Transform that is inside a Billboard, and the content will remain plum as you rotate the device around.<br></blockquote><br></div>aha this is where it gets trickier.  we likely don&#39;t want users to<br>
write Script nodes to integrate accelerations and moments (linear<br>and rotational forces) into velocities.  too hard, too error prone.<br>so adding another similar SFVec3f field for velocity_changed is<br>likely justifiable.<br>
<br>it looks like the CSS example goes one integration step further and<br>provides orientation angles.  which is most helpful for a scene author<br>to use.  presumably we can set the initial orientation as zero when the<br>
node becomes enabled, allowing author control (enable/disable) if a<br>reset capability is needed.<br><br>folowing Keith&#39;s lead, here is a fuller possible signature:<br><br>22 Environmental sensor component<br><br>AccelerationSensor: X3DSensorNode {<br>
 SFBool [in,out]  enabled  TRUE<br> SFVec3f [out]    acceleration_changed [m/s^2]<br> SFVec3f [out]    velocity_changed     [m/s]<br> SFRotation [out] orientation_changed<br> SFNode [in,out]  metadata NULL [X3DMetadataObject]<br>
 SFBool [out]     isActive<br>}<br><br>p.s. it would be helpful if someone actually looked at the Mozilla<br>implementation, we wouldn&#39;t have to speculate as much about what<br>they are doing.  anybody out there? 
<div>
<div></div>
<div class="h5"><br><br>all the best, Don<br>-- <br>Don Brutzman  Naval Postgraduate School, Code USW/Br           <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>Watkins 270   MOVES Institute, Monterey CA 93943-5000 USA  work +1.831.656.2149<br>
X3D, virtual worlds, underwater robots, XMSF  <a href="http://web.nps.navy.mil/~brutzman" target="_blank">http://web.nps.navy.mil/~brutzman</a><br><br></div></div></blockquote></div><br>