3D Graphics - Morphing


Scene Description Format

Each scene file will have the following format:

a
b
p
t
# Source image feature lines
[P1x, P1y][Q1x, Q1y]
...
# Destination image feature lines
[P1x, P1y][Q1x, Q1y]
...

Sample Feature lines

The scene files are specified using the OpenGL coordinate system. Namely, the origin is located at the top left corner of the image, with the positive X-axis direction going across the width of the image, and the positive Y-axis going down the height of the image. In particular, if a scene file feature line is: [P1x, P1y][Q1x, Q1y] = [0, 0][w, h] where w is the width of the image and h is the height, that line has its P endpoint at the top left corner of the image and the Q endpoint at the bottom right corner. To give an idea of what the feature lines look like, here are two screen shots of the feature lines given for the rotated F example and football to basketball example scene files below.

Sample scenes

Notes:

PPM file format

Here is some sample C++ code to read and write to a PPM file. Here is a sample openGL application that reads a ppm image, displays it in a GLUT window, and writes the image to disk. main.cpp.

- Steve