-1

Given a human 3D model, I want to change its shape by giving parameters, like height, waist, bust etc.

From what I gathered, the 3D model should have some 'hooks' around the areas I can change.

Any pointers for this would be very helpful through OpenGL, Three.js or any other means. I don't want to do it in Blender or other 3D manipulation tools. I want it done programatically.

Here's a Sample 3D model

Ivan Rubinson
  • 3,001
  • 4
  • 19
  • 48
spiralarchitect
  • 880
  • 7
  • 19
  • 5
    OpenGL is only a rendering API. You need to manage the geometry yourself (or using a separate library or framework). – molbdnilo Aug 22 '16 at 18:13

1 Answers1

0

What you should do is "tag" a group of vertices together. Then apply a vertex shader to those groups, which changes the position of the vertices to shrink/expand the mesh.


One way to do this is to place a point inside the mesh, and give it a radius. This pretty much means you're creating a sphere. Run the shader on all the vertices inside the sphere. What the shader should do is "inflate" the sphere - moving the vertices away from the center point.

Just transform each vertice away from the center by a certain ammount. (Make a vector from the center to the current vertice, continue the vector, and move the vertice there.

This should work well for the belly.


Another shader you can do is to stretch the mesh vertically (for the person's height). This is more straightforward. Just run on all vertices and add to their height. How much to add - that's what you should figure out. My intuition says it can't be a constant - I think it's a linear function but I'm not sure.

Ivan Rubinson
  • 3,001
  • 4
  • 19
  • 48