[ Description | Requirements | How to use | Example model ]
This page describes how to setup and use the texture map calculation feature of Mesh Viewer.
The Mesh Viewer is able to calculate the texture map for a 3D model. The texture mapping is calculated by estimating a plane to plane mapping (homography) between a jpeg image and a 3D model. The program requires four corresponding points in the 3D model and the image data.
The calculation feature requires the LibGandalf library. Mesh Viewer needs to be build with the target QT_TEXT ("make QT_TEXT"). Potentially, the include (INCPATH) and library (LIBPATH) paths need to be updated with the location of the LibGandalf include and library files.
First, load the 3D model which needs to be texture mapped. The texture mapping feature is activated by pressing the "Mapping" button on the icon bar at the right end. A new window opens where a jpeg image needs to be loaded.
The mapping algorithm requires the selection of four corresponding points in the 3D data and the image data (see the first image below). Points are selected in the model and image with the left mouse button. Corresponding points have the same colour. The texture mapping is only calculated for one (VRML) shape and thus all selected points in the 3D model must lie on the same (VRML) shape (shapes can be displayed with "Display/Shape Colors").
After selecting four corresponding points in the model and image, the texture map is calculated for the shape by pressing the "Calculation" button. The image is automatically mapped onto the 3D model (see the second image below). Note that the image and the model must be in the same directory. Finally, save the 3D model with the texture map as a VRML2 model.
The 3D model used in the example can be found here. The model consists of three planes. The three planes are already segmented into three VRML shapes (enable "Display/Shape Colors" to display shapes).