Side View Rag Doll

Viewable here: http://www.sfu.ca/~mnb2/Biped.exe (scanned for viruses with Kaspersky 6.0)
If you need freeglut, it's available here: http://www.sfu.ca/~mnb2/freeglut.dll

Image

Critique welcome.
Nice! I would get rid of the neck. It is a bit unstable when I pick the guy up by the head due to the light weight neck in the middle.

Are you willing to share your model as a test-bed example?
Sure, I suppose I can do that, since you put all the hard work into the physics 🙂 The code is a bit messy right now, but I'll make a class for the test-bed in the next few days.

I put the neck in there because I'm eventually going to make a platformer with guns, and I didn't want any bullets to slip between the head and torso. Plus, how cool is it to shoot someone in the neck? :p I'll take it out for the test bed though. You're right, it causes a few minor problems.

The biped is modeled after a real person so I could get the proportions right (that was painstaking!). The mass, height, and friction should be fairly realistic too (I looked up values). I approximated the max rotations by how flexible I am 🙂

One thing though... I gave all the body parts a groupIndex of -1 so they don't collide with eachother... but when I create multiple bipeds, I guess they should all have a unique index. Should I require the developer to pass in a unique ID for each biped, or is there an easier/better way to do this?
Thanks! I look forward to your contribution.

You can increment a biped counter and use that as your group index (negated).
Hrm.. it's so obvious, I'm not sure why I didn't think of that. Thanks!
Cool biped, darkzerox.

I was thinking that perhaps you could move the green (right side, I presume) limbs slightly forward, putting it into a 3/4 view and giving a bit of depth to the biped.

And if this makes it to the SVN perhaps it should be as ubiquitous as the bomb 🙂, a biped down the pyramid might be fun 🙂

You could also add motor forces to the joints to simulate a live person, whose limbs will try to cease motion (like in the slider crank test) which could make the biped slightly posable or even trying to always move into a default position. This combined with the 3/4 thing might let the biped stand straight for some bomb chucking 🙂
Thanks Wahooney. I'm not so sure about the 3/4 view, but you're welcome to modify the source. I just spent about 6 hours (on top of the previous 6, placing every vertex by hand) (re)writing 2 new classes: BipedDef and Biped (following Erin's lead). I've included several functions for setting parameters for all the body parts at once so that you don't have to adjust all 17 body parts and 16 joints by hand. A motor torque of about 25 N (default) is enough to make the biped stand up. My system can handle about 20 - 25 bipeds for it begins to lag, which makes for a decent size pile of dead bodies.

I still have to put it into a test class though. I'll do that later.

Then I have to figure out how to get this guy to walk... it's proving to be a bit more difficult than I thought.
anybody who get can get one of these guys to walk is going to have my utmost respect. I'd really like to do a 2D platformer someday with a ragdoll model, but the more I think about it the harder it seems. What happens when it falls over? How do you get it to run and jump? How does it's movement code adapt to different situations: slopes, stairs, etc.?

The only thing I can think of is some adaptive learning routines for movement. I've seen this done with 3d models before. You define the physical structure of the model, it starts twitching randomly, getting positive feedback when it actually manages to take a step or move, eventually the model teaches itself how to walk.

Am I overlooking an obvious easier solution?
ninjascience wrote:
anybody who get can get one of these guys to walk is going to have my utmost respect. I'd really like to do a 2D platformer someday with a ragdoll model, but the more I think about it the harder it seems. What happens when it falls over?


Controlling a simulated 2D biped is still an active area of research in robotics and computer science, there are a lot of papers with useful ideas, however no great solution yet.

You might want to check out the videos on this site for some inspiration; in this case they've sidestepped the problem by making the control of the biped the player's problem! http://www.dgp.toronto.edu/~jflaszlo/interactive-control.html
Spider Man, Spider Man, does whatever a spider can!

http://www.dgp.toronto.edu/~jflaszlo/in ... 10tour.mov

Original thread: https://box2d.org/forum/viewtopic.php?t=178