View Full Version : Good tutorial for morphism?

12-04-2002, 05:42 PM
Does anybody know where I could find a good (and easy) tutorial to implement a simple morphism (like from a cube to a tetrahedron)?

12-04-2002, 07:32 PM
The first thing you have to realize is that you need to have the same triangle structure in source and destination object. I e, the indices you pass to glDrawElements() to draw the things need to be the same. This may mean tesselating one or the other down a bit. It may also mean sliding vertex in/out to "hide" triangles collapsed to edges, geo-morphing style.

Once you have this working, it's a simple matter of lerping each vertex position between the two shapes.

If you need help constructing two meshes that have the same connectivity (triangle list) but different shapes, the easiest way to do it is to model the first shape in your modeler (say, Max) and then clone it and generate the second shape through moving verts -- but don't add or remove any verts or faces! You can verify that it will morph well by using the Max morpher modifier.

12-05-2002, 05:39 AM
I just remembered that on http://nehe.gamedev.net there is a tutorial on morphing one 3d object to another. It's pretty cool. Going from a cube to a tetrahedron..well your cube is going to need more than 8 vertices and 12 triangles I can tell you that. http://www.opengl.org/discussion_boards/ubb/biggrin.gif


12-05-2002, 08:03 AM
I don't see why it needs more than 12 triangles. Pulling vertices towards centres of gravity and "spliting" them as they approach their local attractor, adding more triangles as you go works nicely too.

(disclaimer: I've never implemented this and don't intend to in future - ).

12-05-2002, 11:13 AM
Well sure you can still use the same ol 12 triangles but it wont look very good. Also Robbo you just contradicted yourself. http://www.opengl.org/discussion_boards/ubb/biggrin.gif You say you dont see why it needs more than 12 yet you then say _adding more_ triangles works nicely too. http://www.opengl.org/discussion_boards/ubb/smile.gif

But anyway morphing from one object like a cube that is of course low poly to something that needs quite a bit more tesselation to look worth a damn, somehow more triangles will be needed. Either make the source model have more triangles than it needs or generate more on the fly, which the latter is probably the best bet if that needed to be done. But the nehe tutorial goes into doing this in more detail so check that out. Actually I don't think it goes into adding more tesselation to the destination model (like I was just talking about) if I remember correctly.


12-05-2002, 11:38 AM
I have been interested in this too.

Are there general algorithm that can morph any obeject to any other.
If there are limitation like the number of meshes and the actual shape of the object, that's ok.

what jwatte said, is pretty straight forward to do as long as each vertex is matched with its vertex and ditto for polygons, meshes. The copy method works out right.