Topics: Texture-mapping, parameterizations, relaxation.
Due date : 17.01.02
Your goal in this exercise is to get your hands dirty with computation of a low-distortion parameterization for a general shape 3D object. More specifically, you are required to extend the program you wrote for the previous exercise to receive as input a name of a texture image file, and a single integer number n. Your program should compute a parameterization (assign each vertex of the object's mesh a pair of texture coordinates [u,v] in [0,1]x[0,1]) with as little distortion as possible, and then display the texture-mapped object using OpenGL in your interactive viewer.
This exercise is deliberately somewhat open-ended, and obviously we do not expect a perfect solution for this essentially open problem. It is quite conceivable that despite your best efforts, some of the objects in the collection will result in very distorted texture mapping. That's perfectly fine, as far as we are concerned. On the other hand, your method will be expected to find good parameterizations for simpler objects.
Here's the course of action you should follow: start by superimposing an n by n regular grid over the texture parameter space (remember the parameter n from two paragraph ago?). Now for each junction on this grid you'll need to find a suitable location on the surface of the object. Your first step will be to find an initial guess for all these locations, and the second step will use relaxation in order to improve the locations you assigned in the previous step. The initial guess can be obtained, for example, using a cylinder as an intermediate surface.
As for the second step, we see two ways of doing that:
You can do this exercise in pairs. A pair, however, will be expected to implement both variants for the second step above. A person working on his own, can just choose to implement just one of the two.
It will make sense to prepare a checkerboard texture, since it makes it easy to assess the quality of the parameterization. Also, be sure to prepare a README file that describes what you did, and gives some examples of objects on which the method works well, as well as some on which it fails.