Skip to main content
gamedev.net
🔒 Locked

Rotation

Started by sebastieng Apr 26, 2006 at 2:58 PM 3 replies 950+ views
Original Post
sebastieng
sebastieng
I was wondering how to rotate an object using forces in an fps. When the player move his mouse theres a rotation. If i want to reproduce the same rotation in the same amount of time using force to sync the body, wich formula am i supposed to use? Im sorry for my english btw :$ Thanks in advance for the help.
JohnBolton
JohnBolton
Are you sure you want to use forces to rotate the player? Unless it is necessary for the game, you probably won't like the results. The term you are looking for is "torque". Here is the Wikipedia entry: Torque
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
sebastieng
sebastieng
I want to apply torque to rotate my character around the Y axis just like the command yaw does(Ogre). The problem is i dont know how to apply force to rotate my character and then stop it, just like when i do yaw(angle). Should i constantly check if the desired orientation is reached? (+/- 10%)
JohnBolton
JohnBolton
Quote:
Original post by sebastieng
I want to apply torque to rotate my character around the Y axis just like the command yaw does(Ogre). The problem is i dont know how to apply force to rotate my character and then stop it, just like when i do yaw(angle). Should i constantly check if the desired orientation is reached? (+/- 10%)


You need to decide the amount of torque to be applied and for how long. That will accelerate the rotation up to a certain velocity. You need to decide how long to maintain that velocity, and then figure the amount of torque necessary to slow down the rotation so that it is stops at the right point. Oh, you also need to figure out the mass and moment of inertia of the player.

Are you sure that's what you want to do? Most first-person games don't use force to rotate the player. They simply set the rotation or the speed of rotation depending on the movement of the mouse, stick, or buttons.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
sebastieng
sebastieng
It's mainly for my physic engine, im using newton dynamics and it says that setting the orientation directly on the body would create unrealistic behavior. That's why im trying to rotate the character using torque instead, but the problem when using torque is accuracy. On the graphic engine, im simply rotating the node attached to the player entity.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.