Vibrating/Rotating/Bouncing object

Started by
15 comments, last by Aressera 5 months, 3 weeks ago

@JoeJ

https://physics.stackexchange.com/questions/711644/inertia-tensor-but-expressed-after-undergoing-rotation

In terms of rotating the Inertia matrix look at the last answer. He even explains why it makes sense in terms of angular momentum. And obviously it started working more stable right after I implemented that way of rotating the inertiavalues.

Your reply reminds me that i really should develop more debugging systems for the renderer!

Advertisement

BadProgrammingGuide said:
Your reply reminds me that i really should develop more debugging systems for the renderer!

Oh yes. It took me many years to overcome the laziness of rendering box diagonals, and instead rendering proper boxes made from 12 lines. But oh, it was worth it. :D
Would surely help you here. I would also visualize contact points, contact force magnitudes or impulses, etc.

Still, my own adventure on making a physics engine was not really successful. But the gained experience helped to become a good user of a physics engine at least.
Today i work on self balancing ragdolls, so control problems rather than simulation basics. And here i spend a lot of time on visualizations, which is really helpful, even if it looks confusing to anybody else:

That's an inverted pendulum, swinging left and right. The function plots show me both the predicted future and the measured past. This way i can really see how the small simulation error affects results over time, which would be hard to figure out otherwise.
It takes some time to build up those visuals, but in my experience it's always worth it.

JoeJ said:
Do you know the formula for translating the Inverse tensor from object space into worldspace?

You want the similarity transform. Note that the transform inverse matrix is just the transpose of the rotation matrix, so R^T * I * R.

@Aressera Yeah, I figured it out. But the posted link above (https://physics.stackexchange.com/questions/711644/inertia-tensor-but-expressed-after-undergoing-rotation)​ has the multiplication order different, although does it matter?

@JoeJ You're absolutely right! Once i get done with the friction part of the physics, I'll do some more debug utilities!

The more complicated problem, the better it is to make it visual! Brings you a bit of color to life anyway ;-)

BadProgrammingGuide said:
has the multiplication order different, although does it matter?

I looked at my physics code and I do have R*(I*R^T), where R is the local to world rotation. The order depends on whether you are going from local to world or world to local.

This topic is closed to new replies.

Advertisement