[vtkusers] vtkAssembly : restore postion and rotation stored in quaterion ?

Adam R. Gerlach agerlach at gmail.com
Tue Jan 24 07:57:41 EST 2012


I don't think I can help you much here. I've never used assemblies, but I compute quaternion rotations and translation for doing 3D pose estimation. The order in which you do the translation and rotation depends on how VTK handles the assembly manipulation. Because I've never used those methods I'm probably not the best person to help you with regards to that.  


-- 
Adam R. Gerlach
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Monday, January 23, 2012 at 10:04 PM, Ashika Umanga Umagiliya wrote:

> hi agerlach ,
> 
> did you also interpolate the translation ? if so how did you set the
> position accordingly ?
> I used something like ,
> 
> vtkSmartPointer<vtkTransform> transform=vtkSmartPointer<vtkTransform>::New();
> 
> transform->Translate(capuredState.x,capuredState.y,capuredState.z);
> transform->RotateWXYZ(360-vtkMath::DegreesFromRadians(angle),ax,ay,az);
> transform->Translate(-capuredState.x,-capuredState.y,-capuredState.z);
> 
> assembly->SetUserTransform(transform);
> 
> 
> x,y,z positions in "capturedState" were assigned using the
> assembly->GetCenter() method.
> 
> But this way it does not translate properly.Any tips on this?
> 
> 
> On 24 January 2012 05:14, agerlach <agerlach at gmail.com (mailto:agerlach at gmail.com)> wrote:
> > I have a function that converts quaternions to euler axis rotation and our
> > math is a little different. I know there are more then one ways to do the
> > conversion but I know mine works so using your notation:
> > 
> > double angle = 2. * acos(qw);
> > double ax = 1./sin(angle/2.)*qx;
> > double ay = 1./sin(angle/2.)*qy;
> > double az = 1./sin(angle/2.)*qz;
> > 
> > assembly->RotateWXYZ(360 - vtkMath::DegreesFromRadian(angle), ax, ay, az)
> > 
> > This is from "Aircraft control and simulation" by Stevens
> > 
> > I hope this helps.
> > 
> > 
> > 
> > --
> > View this message in context: http://vtk.1045678.n5.nabble.com/vtkAssembly-restore-postion-and-rotation-stored-in-quaterion-tp5141577p5169608.html
> > Sent from the VTK - Users mailing list archive at Nabble.com (http://Nabble.com).
> > _______________________________________________
> > Powered by www.kitware.com (http://www.kitware.com)
> > 
> > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> > 
> > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> > 
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> > 
> 
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120124/cb7272b2/attachment.htm>


More information about the vtkusers mailing list