<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:navy;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">Hello Matt,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">First I’d note that your VRML file has some errors. It doesn’t have a VRML header, the PlaneSensor contains values of events (in VRML nodes outside of PROTO can
 only contain fields and exposedFields), and in the Script an SFBool value is defined as “false” (VRML requires “FALSE” in upper case). Just wondering which VRML browser are you using?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">In Cortona3D Viewer, your file works in a strange way: when I press the mouse button, the box jumps away in a random (?) direction, but then moves together with
 the mouse. On the other hand, when I set autoOffset to TRUE and remove the script, everything works just fine. Maybe the VRML browser you are using has some errors with PlaneSensors?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">For example, the browser may not like an offset not lying in the XY plane (this could be the cause of the motion being very slow, for example, the mouse motion could
 be mapped to the Z=-10 plane while the box was moving in Z=0). You could try to wrap both box and sensor by a new Transform which would translate everything to Z=-10, then you would not need any offset at all.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">Otherwise, if you still need to simulate the autoOffset (or your VRML browser forces you to do so), you should route translation_changed instead of trackPoint_changed
 to the script. In Cortona3D Viewer, this eliminates the jumps I mentioned above. Please try and see if it works for you. Note the difference: trackPoint_changed is the point the mouse points to; translation_changed is the actual translation of the box.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">                                             Sergey Bederov<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> www-vrml-bounces@web3d.org [mailto:www-vrml-bounces@web3d.org]
<b>On Behalf Of </b>Matthew Fox<br>
<b>Sent:</b> Wednesday, June 29, 2011 9:47 PM<br>
<b>To:</b> www-vrml@web3d.org<br>
<b>Subject:</b> [WWW-Vrml] PlaneSensor Issues<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<br>
<br>
I have been working with drag sensors, specifically the PlaneSensor, and I have come across an issue with the trackpoint feature of the PlaneSensor.  I am attempting to drag a box along the xy plane that is positioned -10 units along the z plane.<br>
Because of this, I set my own offset to 0, 0, -10 for the sensor, but the dragging motion became very jumpy due to the lack of correction that I took away by setting my own offset, and the box did not translate exactly with the mouse, but a good bit less. 
 Therefore, I wrote a script to feign an autoOffset and routed it to the set_offset field of the PlaneSensor so that it would begin where the last drag had ended.  This works very well in all cases except for the first attempt at dragging, which behaves as
 it did before.  Also, when a second click is activated, the box jumps to correct its translation and then acts on the correct translation of the mouse.  I was wondering if any of you would know how to fix it to correct for this problem.  I'll attach some sample
 code to this message.  Thanks so much.<br>
<br>
Sincerely, <br>
Matt<o:p></o:p></p>
</div>
</div>
</body>
</html>