<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Aashish,<br>
<br>
this week I've written a new Interactor style to use a 3dconnexion
SpaceNavigator in Paraview with vrpn server. Translational motion
works fine in parallel and orthogonal projection but rotation is
not finished yet.<br>
<br>
Two things I did not solve:<br>
- the first time a new Interaction is created, PV crashes when the
point vtkVRQueue:Enqueue, this->Mutex->Lock() is reached
(called by newAnalogValue), if I use "Restore State" it works
-> I think anything has to be initialized but did not find it.<br>
- rotation of the scene is confusing to me. I have as input 3
analog values (roll/pitch/yaw) between -1 and +1. I tried to map
this to CameraViewUp with euler-zyx-Transformation. But it does
not work as expected.<br>
<br>
Question at all: what would be the best way to map a scalar value
to the rotation of a scene/view ? What does the buttons
roll/pitch/yaw in the camera-property-menue ? I think I would need
exact the same functions behind theses 3 buttons.<br>
<br>
Here is the code-snippet I tried for that:<br>
<tt><br>
vtkSMPropertyHelper( proxy, "CameraViewUp" ).Get( rot, 3 );
//rotation</tt><br>
<tt> phi= data.data.analog.channel[3]*M_PI/180;</tt><tt><br>
</tt><tt> theta= data.data.analog.channel[4]*M_PI/180;</tt><tt><br>
</tt><tt> psi= data.data.analog.channel[5]*M_PI/180;</tt><tt><br>
</tt><tt><br>
</tt><tt> double x=rot[0];</tt><tt><br>
</tt><tt> double y=rot[1];</tt><tt><br>
</tt><tt> double z=rot[2];</tt><tt><br>
</tt><tt><br>
</tt><tt> double tt[3][3];</tt><tt><br>
</tt><tt> tt[0][0]=cos(theta)*cos(psi);</tt><tt><br>
</tt><tt>
tt[0][1]=-cos(phi)*sin(psi)+sin(phi)*sin(theta)*cos(psi);</tt><tt><br>
</tt><tt>
tt[0][2]=sin(phi)*sin(psi)+cos(phi)*sin(theta)*cos(psi);</tt><tt><br>
</tt><tt><br>
</tt><tt> tt[1][0]=cos(theta)*sin(psi);</tt><tt><br>
</tt><tt>
tt[1][1]=cos(phi)*cos(psi)+sin(phi)*sin(theta)*cos(psi);</tt><tt><br>
</tt><tt>
tt[1][2]=-sin(phi)*cos(psi)+cos(phi)*sin(theta)*sin(psi);</tt><tt><br>
</tt><tt><br>
</tt><tt> tt[2][0]=-sin(theta);</tt><tt><br>
</tt><tt> tt[2][1]=sin(phi)*cos(theta);</tt><tt><br>
</tt><tt> tt[2][2]=cos(phi)*cos(theta);</tt><tt><br>
</tt><tt><br>
</tt><tt> rot[0] = x*tt[0][0]+y*tt[0][1]+z*tt[0][2];</tt><tt><br>
</tt><tt> rot[1] = x*tt[1][0]+y*tt[1][1]+z*tt[1][2];</tt><tt><br>
</tt><tt> rot[2] = x*tt[2][0]+y*tt[2][1]+z*tt[2][2];</tt><tt><br>
</tt><tt><br>
</tt><tt> vtkSMPropertyHelper( proxy, "CameraViewUp" ).Set(
rot, 3 );</tt><br>
<br>
I attached the sourcecode, maybe someone has time over christmas
to have a look.<br>
<br>
Have a nice Christmas time & happy new year,<br>
Christian<br>
<br>
Am 30.11.2012 03:42, schrieb Aashish Chaudhary:<br>
</div>
<blockquote
cite="mid:CAEw35Z_8LUpn2jpmmW8EGZi422XDUvPubgYwOtqbmV6ZUzQnGQ@mail.gmail.com"
type="cite">Hi Christian,
<div><br>
</div>
<div>Are you still interested? if yes, let me know and I can
provide you more help. </div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
<br>
<div class="gmail_quote">On Tue, Nov 6, 2012 at 11:34 AM,
Christian Richter <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:christian.richter@ovgu.de" target="_blank">christian.richter@ovgu.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">ell me how
to write a styl</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
| Aashish Chaudhary <br>
| R&D Engineer <br>
| Kitware Inc. <br>
| <a moz-do-not-send="true" href="http://www.kitware.com">www.kitware.com</a>
<br>
</div>
</blockquote>
<br>
</body>
</html>