Help! - Morphing

I am in desperate need of help! I’m trying to implement an algorithm (Kent, Carlson and Parent) that involves projecting the topology of two shapes onto a unit sphere that, when mapped back onto the objects, allows interpolation between them…however…

I have no idea what a unit sphere is or how to implement it in Opengl…!

Any help would be greatly appreciated…

Thanks…

Ben…

I haven’t looked too closely at the algorithm you’re referring to, but my understanding it this:
You take two meshes and project the vertices out onto a sphere. You can then look at how the vertices land on the sphere to determine correspondences between vertices on the source and target mesh. Then you just animate the vertices moving from their initial to final positions, and voila! A morph.

It’s a nifty idea and probably pretty simple to implement. Just keep in mind that it has a lot of shortcomings too. The biggest being that objects which don’t project well onto a sphere (objects with complex topology) are going to give wacky results. Using this algorithm to morph between a sphere and a torus, for example, would probably not work well.

Oh, and to finally answer your question, a unit sphere is a sphere of radius 1. For the sake of the algorithm, that’s not really that important.

Once again, let me emphasize that I’m not 100% familiar with the algorithm. This is just my recollection of how it works. I’m sure there are details and complexities I’ve omitted.

Thanks alot, my only problem now is how do I project the point onto the surface of the sphere?I have declared a center point that I call within the cube I want to project but how do I project the corner vertex of the cube onto the surface of the sphere (from the center through the corner)…?

Ben…

To map a point onto a unit sphere, find the direction of the original point from the center of the sphere (I believe point - center should work) then normalize the direction and add it to the center. I might be a little off in this, but its something very similar. Of course there are probably many optimizations you could impose here.