View Single Post
  #1  
Old 10-14-2008, 03:47 AM
Sandro Holzer Sandro Holzer is offline
Member
 
Join Date: Jul 2008
Posts: 19
Problem with getEuler and setEuler

Hi

I am working on a little code, where I have a small kinematic that I want to move with some key´s.
When a key is pressed, a function calculates all the necessary new angles of all my bodys. This function gives these values to a second function.

This second function does the following with these values for each body.

Code:
euler = body.getEuler(viz.ABS_GLOBAL)
euler[1] = valuefromfunction
body.setEuler(viz.ABS_GLOBAL)
This works for most of the time, but sometimes when the "valuefromfunction" is beyond 90° the body angle is set wrong by the setEuler funktion.
when I print out the values for valuefromfunction and the getEuler variable, the values are ok. But the vizualisation of the body alternates between two positions, one lets say 88° and the second 92°.
But I think it is only a vizualisation problem, because the value in the next step for the getEuler function is correct (92°).

Even if I use the following code, the vizualisation alternates.

Code:
euler = body.getEuler(viz.ABS_GLOBAL)
euler[1] = 92.0
body.setEuler(viz.ABS_GLOBAL)
I hope I use the commands in the right way.

Perhaps someone can help me.

Sandro
Reply With Quote