WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   MainView and getEuler (https://forum.worldviz.com/showthread.php?t=4109)

shivanangel 01-12-2012 04:05 PM

MainView and getEuler
 
Dear Vizard Staff,

I have a question I'm sure you'll be able to wrap up easily.

I have a viewpoint being controlled by an XBox controller:

Code:


#Move locally in the Left to Right Direction self.viewport.setEuler([self.gRotation[0], 0.0, 0.0], viz.BODY_ORI, viz.REL_LOCAL)
               
#Move globally in the Up to Down Direction
self.viewport.setEuler([0.0, self.gRotation[1], 0.0], viz.HEAD_ORI, viz.REL_LOCAL)
                       
#Roll
self.viewport.setEuler([0.0, 0.0, self.gRotation[2]], viz.HEAD_ORI, viz.REL_LOCAL)

The problem comes up when I am attempting to save the orientation of the MainView for another program using this script.

When I try and use getEuler(), the values I get back do not match the actual orientation of the MainView.

I've tried using the masks for the body and the head, however I still can not match the original orientation.

Is there a method to concatenate the matrix transforms so I can get the final orientation value to save the orientation?

farshizzo 01-20-2012 10:31 AM

It's hard to tell what the problem is without more information or sample code. Either way, I would recommend using quaternions (getQuat/setQuat) to save and restore orientations.


All times are GMT -7. The time now is 01:31 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC