# Rotation Degrees of Freedom in 2D?

This topic is 4924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I am experimenting with a simple physics engine based off the Jakobsen paper "Advanced Character Physics". Things are going quite well with this paper and my only question is what value does delta t (change in time) refer to in the integration equation? However, I have been doing some more research and came across "Verlet Integration and Constraints in a Six Degree of Freedom Rigid Body Physics Simulatoin" (link: http://www.only4gurus.net/miscellaneous/baltman_rick.pdf). It seems they are taking the primary ideas presented by Jakobsen but adding in rotation so that rigid bodies can be simulated with a single point instead of having to connect 2 or 3 to simulate rotation as in Jakobsen's version. My question concerns the rotational equations. Since the article is for 3D Graphics, they are using Quaternion's for rotation. However, I am really only concerned with 2D physics engine and thus have to change the rotation equations. For the most part I can do that, but when it comes to the equations for the Pin Constriant, I have no idea on how to convert that from 3D to 2D. Anyone out there that can help? Also, in your opinions, would you even add the rotational degrees of freedom or just stick to a strict Jakobsen version, connecting points to create a rigid body? Thanks a bunch, -Phil

##### Share on other sites
delta time is the frame time (very generally speaking). It's the integration timestep. So, you get your frame rate, and plug that into the equation as a delta_time.

however, verlet doesn't deal very well with variable frame rates. see here

http://www.gamedev.net/reference/articles/article2200.asp

as for the pin constraint, although I have that doc you are talking about, I haven't read it and applied it yet, nt even 2D.

But, as for your concern about using an angular constraint over a set of linear constraint, it makes sense for some things (connecting bodies with pins, like ragdoll limbs), but I'd keep the linear stiff constraint for rigid elements (like a cube).

Although, it might be interestingt to implement his mix of rigid / particle physics, using a triangle (in 2D) to define the orientation and position of a more general body.

##### Share on other sites

The thing is, at least how I understand it, is that in order to get rotation in the Jakobsen paper, you must create a triangle to represent a rigid body.

In the second paper, they add rotional motion to a single particle so that you do not have to do this.

I think I might end up using a triangle at the moment.

##### Share on other sites
you don't really need to apply his triangle technique to get rotational movement in a body made of linked particles. The verlet and constraint method should naturally make body rotate around by itself. Or I didn't understand your question correctly.

I haven't read the second paper. If you have a link maybe [grin]

##### Share on other sites
I know what you mean. I implemented a simple verlet integrator for 2D a little bit ago.
I think I will simply continue as is..

The second paper is can be found here: http://www.only4gurus.net/miscellaneous/baltman_rick.pdf

##### Share on other sites
Quote:
 oliii:you don't really need to apply his triangle technique to get rotational movement in a body made of linked particles. The verlet and constraint method should naturally make body rotate around by itself. Or I didn't understand your question correctly.

He meant this:

Quote:
 The thing is, at least how I understand it, is that in order to get rotation in the Jakobsen paper, you must create a triangle to represent a rigid body.In the second paper, they add rotional motion to a single particle so that you do not have to do this.

AFAIK you have to create at least two particles linked together to have them rotate etc., but I may be wrong.

##### Share on other sites
hi,

yes it is possible to simplify the paper in question to 2d, and I use a hybrid version of it in my current 2d physics system.

All you need to do is junk all the quaternion stuff and treat the angular velocity in much the same way as the linear equations.

so just as you have variables for linear velocity and acceleration (depending if you want to use that system , the paper takes a two pronged approach), define two variables for angular velocity and acceleration and solve by plugging them into the linear equations given in the paper.

I cant remember off the top of my head what I did with the pin constraint , ill have a look at my code and tell you tomorrow after ive had some sleep (as you can probably tell by how poorly this post is explained im very tired) :)

##### Share on other sites
Koshmaar: that is exactly what i mean.

Structure: Cool. I suppose it's time for me to get my physics equations out again :) and experiment a bit. It's a good thing I don't need any of the Quaternion stuff, since I don't know it. Anyways, the pin constraint seems the most complicated so any help would be great. Thanks again Structure.

##### Share on other sites
hi, more awake now,

I need to know a little bit about what your trying to do so I can advise you best, are you planning on using the velocity less or velocity representation?

and do you have any experience with impulse based rigid body physics, as the paper really transcends into a version of baraff’s work with a different integrator to make it more stable at joints.

##### Share on other sites
the plan is velocityless.
And, unfortunatly, I do not know much. This is all one be learning experience for me.
I will take a look at the Baraff article.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634091
• Total Posts
3015435
×