Rigid Body Dynamics for Video Games: Calculating Velocity Vectors

In summary, The conversation discusses the development of a video game with a character using rigid-body physics. The character's movement is calculated using velocity vectors and the problem at hand is how to calculate the velocity vectors for joints with restricted angles. A potential solution is to use the reference point and angular velocity to determine the velocity of any given point. However, the question of how to determine the axis of rotation and angular velocity remains.
  • #1
Vasco_F
3
0
Hi,

I'm developing a video game, in which I'm making a charactar with rigid-body physics (sometimes called "ragdoll" physics). The way I've made it is probably not completely realistic, because I only use velocity vectors to calculate the position of each joint of the "ragdoll", based on an initial velocity vector applied to a joint. If you want to check it out, you can download it http://mega.ist.utl.pt/~vbfr/Ragdoll.zip"

The way I do this is illustated in this image http://mega.ist.utl.pt/~vbfr/noangle.png"Anyway, the problem I have now is how to calculate the velocity vector of joints that make an angle that is restricted (an angle that shouldn't get any bigger, for example). Please see this simplified diagram that illustrates my problem: http://mega.ist.utl.pt/~vbfr/angle2.png"

In the diagram, how should I calculate vectors v1 and v2? Note that in the diagram, the entire body should be rigid, because of the angle restriction.

I would truly appreciante any help on this...
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
If I understand the problem correctly, that the indicated angle should remain constant? Then solution is simply;

[tex]\vec{v} = \vec{v_{1}} = \vec{v_{2}}[/tex]
 
  • #3
That's what I though at first, but that's not correct because the whole body should rotate, until the rotation stabilizes when the body is in kind of a horizontal position (I don't know how to explain it better but if you don't understand I'll draw a diagram). Imagine you have something shaped like a "V" on a table and you drag one end.
 
  • #4
The motion of a rigid body can be specified by giving:

1) the motion of a specific point (pick a point, say for instance point 1, and use it as a reference).

2) the angular velocity of rotation (done by specifying an axis of rotation and an angular velocity, i.e. a vector [itex]\hat{\omega}[/itex].

The formula for the velocity [itex]v_i[/itex] of any point with coordinates [itex]r_i[/itex] will be:

[tex]
v_i = v_{ref} + \hat{w} \times (r_i - r_{ref})
[/tex]

[itex]v_{ref}[/itex] is the velocity of the reference point
[itex]r_{ref}[/itex] are the coordinates of the reference point
[itex]r_i - r_{ref}[/itex] is the difference in coordinates between the reference point and the arbitrary point [itex]r_i[/itex] which has the velocity [itex]v_i[/itex].

Hopefully you are familiar with the vector cross product, if not try reading

http://en.wikipedia.org/wiki/Cross_product

and ask questions as needed.
 
  • #5
Thank you!

I just didn't understand one thing, how do I know what's the axis of rotation and angular velocity?
 

1. What is Rigid Body Dynamics?

Rigid Body Dynamics is a physics framework used in video games to simulate the movement and interactions of objects as if they were solid, non-deformable bodies. It takes into account factors like mass, velocity, and forces to accurately calculate the motion of objects in a virtual environment.

2. How is velocity calculated in Rigid Body Dynamics?

In Rigid Body Dynamics, velocity is calculated by taking into account the object's mass and the forces acting on it. The formula for calculating velocity is V = P * 1/M, where V is velocity, P is momentum, and M is mass. This calculation is done for each axis of movement (x, y, and z) to determine the object's overall velocity vector.

3. What is a velocity vector in Rigid Body Dynamics?

A velocity vector in Rigid Body Dynamics is a mathematical representation of an object's speed and direction of movement. It consists of three components: the object's velocity along the x-axis, y-axis, and z-axis. These components are used to determine the object's overall speed and direction of movement in 3D space.

4. How is Rigid Body Dynamics used in video games?

Rigid Body Dynamics is used in video games to create realistic and accurate movement and interactions between objects. It is especially useful in games that involve physics-based puzzles, vehicle simulations, or character animations. Rigid Body Dynamics allows game developers to create more immersive and believable gameplay experiences.

5. Are there any limitations to using Rigid Body Dynamics in video games?

While Rigid Body Dynamics is a powerful tool for creating realistic physics in video games, it does have some limitations. One limitation is that it does not take into account the deformability of objects, so it may not accurately simulate the movement of objects that can bend or break. Additionally, Rigid Body Dynamics calculations can be computationally expensive, so it may not be suitable for real-time applications with a large number of objects.

Similar threads

  • Mechanics
Replies
2
Views
1K
Replies
2
Views
10K
  • Mechanics
Replies
19
Views
1K
Replies
1
Views
1K
  • General Engineering
Replies
1
Views
1K
Replies
1
Views
1K
  • Mechanical Engineering
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
Back
Top