# Rotation matrix and object

(Devas73) #1

Hi, I hope this is the right forum to post this question (no more Q&A)…
I am trying to use a very powerful physics engine called ODE.
I have the position (vector) and rotation (4x4 matrix) of the simulated object and I want to update the corresponding Blender object with python.
Blender has only RotX, RotY and RotZ, there is no way to manipulate directly the object matrix, right?
In this case the best that I can do is to calculate the angles with trigonometry from the rotation matrix and set the Rot* fields.

(nemesis) #2

I’m not sure what you’re trying to do. Could you explain some more?

(theeth) #3

he wants to extract the Euler rotation angle from a 4x4 rotation matrix (if you didn’t get a thing from what I said, I really don’t need to explain more).

Martin

(Devas73) #4

I will find how to get the euler angles from the matrix, my question is if this is the only method or is there anybody that solved the problem in a more efficient/rational way… thanks anyway, I really hope to make this work 'cause it would boost the interest around Blender (imagine what you can do with the accurate physical behaviour granted by ODE… if you’re curious, pay a visit to http://www.q12.org where the genius Russ Smith give us his awesome library) - this engine is much more powerful than Blender one and much faster (if only NAN asked Russ to license his engine, probably the game engine would have been 5x faster).
I plan to use it for animations, but it’s so fast that it could be used also on the real time side.

(eeshlo) #5

JM Soler had a solution to this as well…
Anyway, I’d be interested to hear about your progress with this. Of course I knew about ODE, it is not the only dynamics library, there are several others, but ODE is one of the more powerful ones, the author has worked on the highly estimated MathEngine as well. I could not have used this since the plan was for Dynamica to go commercial, so I have to do my own stuff, and of course it is not in any way even remotely comparable to ODE…