Warp Texture Placement Editor

Quick Contents
VLAB Home

Overview

The use of textures can enhance the appearance of a model. Landmark features, such as veins on a leaf, must be placed properly on the surface. VLAB Texture Placement Editor allows the user to warp the texture on the surface, editing the texture image so as when it is mapped by the renderer (for example, CPFG) it will be properly placed. Figure 1 shows textures used in a model rendered in CPFG.

Figure 1 - Placing textures on objects is a simple way to enhance the realism of an image.

The Texture Placement Editor uses the Delauney triangulation algorithm. The convex hull is defined as the smallest convex polygon that completely encloses a set of points. A Delauney triangulation for a set of points can be calculated from the convex hull of a projection of the points onto a parabola in a space one dimension higher than that of the points themselves. When a point is added or deleted, a new triangulation is calculated. The image is scan-converted and warped within these triangles as the points are moved.

Warp Execution

The VLAB Texture Placement Editor is invoked using the following command line arguments:

> warp [surface.s] [source_image.ppm] [destination_image.ppm]

The first argument is the surface file.

The second is the original image, that is to be warped onto the surface.

The third is the deformed image, that is generated by warping.

Note: Using the above arguments ensures that the original texture image is not modified. Of course, the original image can be overwritten with the deformed image by using the same filename for both arguments.

Menu, Display and Interaction

The VLAB Texture Placement Editor consists of two windows: the Texture Warp Window and the Surface View Window. The Texture Warp Window displays the texture image. The image is shown actual size and cannot be resized. Points can be placed and moved in the Texture Warp Window. The Surface View Window allows the user to rotate, translate and zoom the surface in 3D space to view the placement of the texture. As the texture is modified, the surface is updated. There are different mouse operations in each window (refer to Table 4 and Table 5 for a list).

Figure 2 - A sample Warp Texture Placement Editor screen. Shows Texture Warp Window (left) and Surface View Window (right).

Figure 3 - The file menu.

Save Texture Saves the current warped texture as the deformed image file specified at the command line.
Save Texture As... Opens a dialog in which to specify the file to saves the current warped texture as.
Save Project Save the triangulation data for the project.
Load Texture Reloads the original texture specified at the comand line.
Load Texture From... Opens a dialog in which to specify the file to load as the original texture.
Load Surface Reloads the surface definition file specified at the comand line.
Load Surface From... Opens a dialog in which to specify the surface definition file.
Load Project Reloads the project specified at the command line. The project is a set of control points and triangulation data that has been previously saved.
Exit Closes both windows and exits the Texture Placement Editor.

Table 1 - A description of the file menu.

Figure 4 - The edit menu.

Show Points Toggle option to show or hide the triangulation control points.
Show Triangles Toggle option to show or hide lines forming triangles.
Clear Triangulation Physically removes all control points and correspomding triangulation data.

Table 2 - A description of the edit menu.

Figure 5 - The help menu.

About Displays general information about the current version of browser.
Help Displays basic help information.

Table 3 - A description of the help menu.

Texture Warp Window

Left button

  • Click to add a new point.

Middle button

  • Click and drag to move point.

Right Button

  • Click to delete point.

Table 4 - Mouse Operations in Texture Warp Window.

Surface View Window

Left button

  • Click and drag to rotate about the centre of the surface.

Middle button

  • Click and drag to zoom. Move the mouse upwards to zoom in, downwards to zoom out..

Right Button

  • Click and drag to translate on the view plane.

Table 5 - Mouse Operations in Surface View Window.

Example

The following figures demonstrate how a control point can be moved to warp a texture on a surface. Notice the movement of the upper point upwards and to the right. Notice also how the texture is displaced on the surface, but only locally near the point that has been moved. The texture remains the same along the dark band at the bottom, for instance. The shape of the red border also remains the same.

Figure 6a - A texture and surface with 3 texture control points. The points are un-moved.

Figure 6b - The warped texture; the upper point has been moved upwards and to the right.

File Formats

Texture Files (.ppm)

The texture is simply an image file. The Texture Placement Editor works with two texture files: the original image and the deformed image.

The two texture files must be loaded at the command line. They can also be loaded or reloaded from within the application.

Surface Files (.s)

A surface file can be created using the Bezier Surface Editor. Refer to Bezier Surface Editor: Surface File Format.

The surface file must be loaded at the command line. It can also be loaded or reloaded from within the application.

Project Files (.wrp)

A project file contains the control point and triangulation data. It can be generated by selecting Save Project from File menu.

A project file can be loaded at the command line only, and is optional.

Credits

Samantha Filkas, Joanne Penner - Texture Placement Editor Implementation vL1.0

Joanne Penner - Documentation vL1.0

Bugs

1. The only file format supported for texture images is ppm. An image editing program, such as Gimp, can be used to convert between file formats.

VLAB Home

Last updated December, 2001 by Joanne Penner