Posts Tagged torques

Still working on Torques

Hello my totally-not-expedible minions!

Finally feel like I’m getting somewhere with these torques, so I thought I’d share a bit of the pain and frustration fun times!

I gave in and repurposed the debug text routine to draw the actual values of torques to the screen so I could debug them. I wasn’t sure whether the actual calculated values were wrong, or just the display arrows.

Turns out, both were: the calculated values were wrong, and the display arrows were not even reflecting them accurately. So I’ve stopped looking for a quick fix and am stepping through the code as best I can, fixing things as I go.

I think I’ve found the first major problem: it’s a bit hard to explain, so I’ll diagram it:

And now everything makes sense forever.

And now everything makes sense forever.

The short version is that in order to calculate torque I need to calculate both distance and magnitude perpendicular to the bone. If they were parallel, then there would be no torque and the bone would face compressive forces instead.

The problem is that by crossing the Force’s Normalised Magnitude Vector with the Bone Rotation, we introduce it’s *direction* into the equation. Then later on we calculate the Dot Product of that and the Forces full magnitude vector, multiplying it’s direction a second time and resulting in a torque going the wrong way.

If you’re by some miracle still following, then a) you have a better attention span than me and b) I’ll probably fix this by removing the final Dot product: just multiply cross2 by the force length and call it a day.

And then I can finally get to work on why the display arrows are crap.

Cheers!
Qu

* * * * *

PS: The Orbital EMP Cannon is down again. We sent an investigation party, and they reported that the living quarters are for some reason highly radioactive and not fit for human habitation. They also said something about millions of spiders before descending into incoherent and extremely uninformative screaming.

I’m sure they’re fine.

We’re now taking volunteers for the cleanup party. Biohazard suits and flamethrowers will be provided.

, , , , ,

3 Comments

Torque Screenshot

Screenshot…

Torques

Comments:

– Darker, linear arrows are Bones.
– Brighter, circular arrows are torques.
– Torque display arrows scale with torque magnitude.
– Torque Colour matches Bone colour (the orange torque goes with the dark-orange bone, which is the neck)
– Compressive and tensile forces are not displayed (though they *are* calculated).
– The creature was animating when this screenshot was taken, which is why the bones don’t match the leg.
– Torques are only calculated with Mass: reaction forces are not yet accounted for. Imagine the creature hanging from a string wound around it’s torso: those are the forces you see here.
– I’m not doing all this visualisation just for debugging: I intend to include the skeletal view (cleaned up, of course) in the final release.

, ,

2 Comments