I'd like to have a procedural system that uses a string of data to create a 3d creature. The way I've thought to do this is to use the code to generate a simple creature skeleton (I'll get to the skin generation when I have time) so I can test different source data's effect on the structure produced.

How can i use a set of data to generate the simple 3d skeleton?

The code would have information used to show what type of bone it was(hierarchy), the bone length, and how the bone was positioned and use this to make the model. (At least in planning, I don't know how to implement it)

Edit: The goal is to create creatures of different forms and skeletons. The creation will be mirrored down the spine so both sides are the same.

I'd like it to be highly adaptable but I'd like to specify a max of 4 legs and 4 arms (8 limb max only 4 on ground for walking). Being able to create a basic structure for humanoids, quadrupeds, and mixes (like a centaur or biped with no arms) is the goal.

I've looked for how to create a model off of the code procedurally, looking at stuff like FRep isosurfaces and metaballs, but I'm stumped on how to make it happen. I decided any progress is better that none, so I'd like to get a generator for something like an animators skeleton example to make sure I can get working structures (and later have something to work with to begin working on the animation algorithm).

Sorry for the lack of information at first, I was trying to keep the question simple. If you have an idea for the creation of the structure(skeleton) or maybe even the form itself I'd appreciate the help. Thanks

  • \$\begingroup\$ Please describe what you mean by "a basic character skeleton". A humanoid? 2 Arms, 2 Legs? 4 Legs? Arbitrary number of legs/arms? You need to be more specific about what you want to achieve. Also: Will this creature be animated? \$\endgroup\$ – bummzack Dec 24 '11 at 12:26
  • \$\begingroup\$ It's not an easy task. I don't have a link but search for interviews with the Spore game team. \$\endgroup\$ – Patrick Hughes Dec 25 '11 at 10:29

If you're providing all the information for the bones, then really this is more of a importer isn't it? The code is not really generating any content, it's simply displaying the content you provide.

Start with the simple case of a single bone. Make sure your code can read the bone specifications and draws the bone correctly (starting out with simple lines would be easiest, perhaps colored differently at each end?). Then move to two bones, ensure they line up the way you want. Then try adding bones that are to be drawn symmetrically. You could probably define these bones to have specific properties like what kind of joint they have, and if they are mirrored across the body. You could do some things to help visualize the data, for example drawing ball and socket joints as a sphere, and elbow joints as a cylinder.

If you're planning on animating this, you'll need to do a bit of work there. Likely you'd want to use inverse kinematics. The book Game Programming Gems 8 has a section on creating a "Non-Iterative--Closed-Form--Inverse-Kinematic-Chain-Solver" a mouth full for sure, but nevertheless helpful.

Even with a IK solver, you're going to have a very difficult time creating procedurally generated animations for walking/movement. As @Patrick Hughes mentioned, Spore is a great example of this challenge. There's a nice resource called Real-time Motion Retargeting to Highly Varied User-Created Morphologies that should help you start to understand the undertaking you have ahead of you. Make sure you take a look at the PDF linked on that page.

That being said, if you created an animation system that could do this, you'd have no trouble getting a job :).


I'll add more details on the actual drawing of the bones. First, let me define some of the details you'll have to keep track of, for each bone.

  • Bone start position - This is a 3D offset from the parent end position. For limbs and such, this would just be zeros, or at least small numbers, but it's better to have this information for things like ribs where the offset could be greater.

  • Bone line equation - I recommend starting out with straight lines, but you may want curved bones in the future (ribs, clavicle, etc). This information would include the bone length and direction. You'd use this information for calculating mid-point attachments to this bone.

  • Bone end position - This is a 3D offset from this bones start position. You'll need this for the starting point of some child bones. This can just be computed from the start position and the line equation. It's just nice to have to so you don't have to compute it every time you want it.

  • Bone connection type - There are at least one of these per bone, it could be a joint or something more solid like the ribs connecting to the sternum. You'll want this information at first to draw what the connection looks like, and maybe eventually to tell your animation system how this bone is allowed to move.

Your bones should be laid out in some sort of tree data structure. With the root bone (generally the hip or base of the spine) being at the root of the tree.

Start with the character position in 3D space. This is the starting point for all the bones, it's the root. Use this position as the offset for your first bone. The way the bones are set up, once you have the first position, you can calculate the start/end of every bone in the system. Once you have all the start and end positions of the bones in your system, you're ready to draw.

I'm going to assume you're starting with straight lines for bones.

Draw in whatever order you want, but you might as well parse the tree you already have set up. So start with the root bone, and draw it. This is as simple as drawing a line from start position to end position of the first bone. If you're not sure how to draw a line in your system of choice, I'd recommend taking a step back and deciding if you're ready for this project.

Continue parsing the tree and drawing lines from the start position to the end position for each bone. You may want to pull this information out into some other data structure for quicker drawing, but that's outside the scope of this answer.

I have to say though, from your responses so far, I think this project may be beyond your current skills.

|improve this answer|||||
  • \$\begingroup\$ I especially second the last line :D. If you manage this stuff, you'd get any programming/design job you want. \$\endgroup\$ – Joshua Hedges Dec 26 '11 at 5:42
  • \$\begingroup\$ The initial problem I'm having is turning the data string for the bone information into a model. I've looked into turtle graphics, primitive instancing, l-systems, metaballs, and FReps. But I still don't know what to use for the bone modeling. My goal is to make the bones and joints model out of simple instructions (like the bone length, joint type, and direction the bone grows in). I just can't find a method to draw the bones. \$\endgroup\$ – user12092 Dec 26 '11 at 14:44
  • \$\begingroup\$ I'm trying to understand exactly what you're starting with. Are you starting with the lengths, joint types and direction of each bone? Or are you wanting to generate that information? \$\endgroup\$ – MichaelHouse Dec 26 '11 at 16:33
  • \$\begingroup\$ Basically I want to code a model from a set of "genes". The genes would show parameters like the lengths, joint types, direction, and such. Then the system I want to make would use that information to create a 3d model. Then I could alter the genes/parameters to create a different model. So the system is like turning DNA from genotype to phenotype. I need to be able to create a skeleton/model from a set of parameters. Thanks for helping out btw \$\endgroup\$ – user12092 Dec 26 '11 at 17:32
  • \$\begingroup\$ It probably is beyond my current skills. However this is the project I'd like to start. I've been trying to learn as much as I can so I can chose which system to start figuring it out in, since once I start the system will be my limiting factor. Thank you for your help. \$\endgroup\$ – user12092 Dec 26 '11 at 18:47

From what I understood reading your question, I'm assuming you want to procedurally generate a character, given some arbitrary data. Eg. a given username will generate a unique creature for that user.

The way I would go about this is to extract a number from the username (by using something like a CRC sum, or some other form of hashing). Then use that number as seed for a random-generator.

As Byte56 already mentioned in his excellent answer, going for a fully procedural approach is going to be very hard. I think it might be simpler to have multiple basic skeleton setups that can be parametrized. So maybe you have an armature for two, four and six legs with some extreme setups. Eg. a humanoid with very short legs, one with normal legs and another one with very long legs.

Ideally you would have existing animation data for (at least) the extreme cases, so that you can interpolate/morph intermediate states from one extreme to the other.

If you then have a user-name, you would seed the random generator as described above and first do a random roll which basic armature to use. Then perform other random rolls to determine other factors, such as which "intermediate state" to use, "animation speed", "skin color" etc.

Even though this approach isn't fully procedural, it will still generate a unique character for every username (given that you have sufficient base-armatures and variations thereof). As long as you just use this to create creatures using a given input and don't allow the users to add more limbs (like in Spore), the outlined approach should be much simpler to implement than a fully procedural character-generator.

|improve this answer|||||
  • \$\begingroup\$ I'm more looking for data with direction. Less like arbitrary data and more like DNA, I want it to have the instructions to make the model.The user won't be able to specify any inputs either. Creating a skeleton would work, but how would I be able to make the bone lengths and such parametrizable? \$\endgroup\$ – user12092 Dec 26 '11 at 14:50
  • \$\begingroup\$ @user12082 Starting simpler is almost always the best way to go. You would parameterize skeletons by defining specific aspects of the you'd like to change from skeleton to skeleton. From simple (height of skeleton), to complex (size of feet, leg length, slouch angle, cranium circumference). Then your generator takes those aspects into account when creating the skeleton. \$\endgroup\$ – MichaelHouse Dec 26 '11 at 16:43
  • \$\begingroup\$ But how would I take those parameters to make the model's structure, like how they fit together into joints and such. I know how to set basic shapes to parameters in 3d modeling programs, but not how to make multiple shapes change while staying connected to each other. I don't really know where to start making the parts parameterized in the skeleton either. \$\endgroup\$ – user12092 Dec 26 '11 at 17:40
  • \$\begingroup\$ Multiple shapes changing while connected to each other is animation. And as I mentioned in my answer, that's going to be exceedingly difficult. The parameters are just for creating the skeleton, they don't really apply after it's been created. \$\endgroup\$ – MichaelHouse Dec 26 '11 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.