PDA

View Full Version : Bones, skinning, and deformation



DarkOne
01-14-2012, 05:24 PM
I am working towards building a 3D character development program, and I wish to implement an editable spinal column, similar to that of the Spore Creature Creator.

Basically, the body mesh is bound to several vertebrae. By using the scroll-wheel of the mouse, the user can enlarge individual vertebrae, and thus spherically enlarge a small portion of the mesh that is bound to the vertebrae that was enlarged.

I figure that each vertebrae represents a sphere, and the spheres are somewhat overlapping each other. Each sphere is bound to the bone, and each sphere is controlled individually by the vertebrae.

Now what I don't understand is how to skin the whole object. It seems like some sort of 'shrink-wrap' method would be used. I am new to OpenGL, though I do have some programming experience.

If anyone could suggest a book, a website, a video, or a tutorial that might help me to better understand how to solve this problem, well, that would be great.

Thank You

ZbuffeR
01-14-2012, 05:50 PM
For each vertex, compute distance to bone center. This will give the weight of the modification that this bone will apply to this vertex.
Then there are lots of tweaks, for example paint custom weights for the vertex-bone pair. You can also use cylindrical bones, etc.

Keywords : vertex skinning with bones


Some links :
http://content.gpwiki.org/index.php/OpenGL:Tutorials:Basic_Bones_System

http://wiki.blender.org/index.php/Doc:2.6/Manual/Rigging/Armatures/Visualization
https://developer.valvesoftware.com/wiki/Animation_in_Blender

dorbie
01-14-2012, 07:16 PM
For that scenario you'd want to weight by proximity to the vertebrae.

A non interpolated single bone solution would give a bone weight of 1.0 to the nearest vertebra. Beyond that you would weight by proximity to the nearest 2 vertebrae, being 1.0 at each vertebra and then a blend between.

You would calculate proximity based on length along the major axis of the spine.

I can also imagine that as the spine flexes you may have large transformations as a result of vertices being a distance from the spine, you can solve this by looking further along the spine at more bones, so maybe up to 4 bones per vertex of spinal influence to low pass large kinks, the further from the spine the more convolved the weights would be, solving the self-intersecting problems that would otherwise arise.

DarkOne
01-15-2012, 03:09 PM
Okay, I think I understand about the bones and vertex weight, it makes some sense. I also understand calculating for kinks, and keeping the mesh smooth.

How to increase a small portion of the diameter of the mesh, based on one vertebrae?

It seems as though I need some spheres, with each sphere anchored at the center of the vertebrae. Then, as the sphere grows, it affects the surrounding vertexes to deform them via the diameter of the individual sphere.

So each vertex will be displaced along the line running from the center of the vertebrae/sphere thru the vertex.

I'll have to try it I guess. If anyone reading this has more authority on the subject, feel free to lay down the law.

Zbuffer:
I noticed that you posted some links to blender tutorials, to illustrate your point. Do you know of a lib to load meshes with bones created in blender to opengl?

ZbuffeR
01-16-2012, 05:08 AM
You can try assimp : http://assimp.sourceforge.net
Seem to read .blend files, and supports bones.