Singing Potatoes
Wednesday, 10 March 2004
Insane with Constraints

With my model of Lovecraft's Great Race (or, as Karen calls it, "Lemon Head") nearly finished, I figured I'd get the skeletal constraints out of the way. The constraints are what let me tell it things like "this bone shouldn't rotate more than thirty degrees", "orient this bone in the same direction as this other one", "make this bone chain respond to gravity and inertia" and so forth.

Unfortunately, the software doesn't let you copy a constraint from one bone to the other, so if you want a tentacle with nineteen bones to have all the same constraints throughout the chain, you have to manually create each constraint and type in the minimum/maximum rotation values.

Fortunately, the models are stored as plain text, so I wrote a PHP script to generate all the constraints for me, then spit the data out into a text file so I could simply copy the information and paste it into the model. It took about an hour to write the script. I hate to think how long it would have taken to manually create 140 "spherical limits" constraints, 276 "orient like" constraints and 12 "dynamic constraints". I tried adding some inverse kinematics constraints in there too, but tentacles really don't seem to like those. Oh well, the forward kinematics control rig I've built works well enough.

I'm really happy with the way it's turning out. I added a nice "tentacle oscillation" action to it, so the tentacles depending from the head don't just hang there limply if the head's been still for a while. I think I need to add some warts or bumps to the head, though; it's looking too smooth, even with the cellular bumpmap.

Posted by godfrey (link)
Comments
Neat! Harryhausen would dig it!