Question on Torque

wyrmmage
Posts: 4
Joined: Fri Feb 01, 2008 3:23 am

Question on Torque

Post by wyrmmage »

hello everyone :)
I'm a complete newbie when it comes to Bullet Physics...and physics in general, for that matter, so I'm sorry if this is a dumb question. I'd like to have a cube that behaves like a cube normally should (I mean that I don't want to set the object as being kinematic and having a mass of 0), but I want to be able to move the cube based on my mouse movement. Every time I move my mouse one pixel to the right, I want to the cube to rotate clockwise one degree in one second and then stop. Now, I realize that I could just set a larger rotation on the cube manually, but I would rather not do that.

Since my cube has friction, and the plane that the cube is resting on has friction, I figured that I could either apply torque or torque-impulse (which should I use?) to have the cube start rotating, and then friction would slow it down the proper amount.

I'm lost on how I would go about deriving this equation, however? Could someone give me a nudge in the right direction (or provide the actual equation with a little explanation)?

Thanks in advance :)
-wyrmmage
Oogst
Posts: 25
Joined: Thu Apr 10, 2008 11:19 am
Location: Utrecht, Netherlands

Re: Question on Torque

Post by Oogst »

I don't know the exact formula, but I think you need to take a look at the intertia tensor and do something with that. The intertia tensor is like mass, only for rotation. So if the x in the interia tensor is very high, then rotating over the x-axis requires a lot of force. It seems like rotating to a specific position through torque should take that into account.