Homogenous coordinates for physics engine

Started by
10 comments, last by raigan 16 years, 4 months ago
Yeah, after playing around with trig identities I figured that out. The angular velocity matrix looks like this:

[[ cos(omega * time), -sin(omega * time), 0] [ sin(omega * time),  cos(omega * time), 0] [                 0,                  0, 1]]


The final first derivative update matrix ends up looking like this:

[[ cos(omega * time), -sin(omega * time), vx * time] [ sin(omega * time),  cos(omega * time), vy * time] [                 0,                  0,         1]]


With vx and vy being the linear velocity terms expressed in local space.

Then you just do your position/orientation matrix * first derivative update matrix. However, the problem here is that the first derivative matrix has to be pre-integrated, because for angular velocity the time term is inside the trig functions, and for linear velocity the time term is just a scalar multiply.

Which isn't a huge problem if the time step is fixed. However, I don't see how to add the final term: + 1/2 * alpha * t^2. That is, the second derivative matrix. And I'm not sure how to build such a matrix from forces being applied to produce torque and acceleration.
[size=2]Darwinbots - [size=2]Artificial life simulation
Advertisement
I was under the impression that matrices are one of the most unwieldy ways to represent an orientation -- for one thing, they're super-redundant (a 2x2 array in 2D rather than a single scalar).

This topic is closed to new replies.

Advertisement