HW4: Texturing
Documentation

Emily Gibson
ID: 2315

CISC 640
November 19, 2003

 



Part 1: Texture Synthesis

User Interface: Command Line Input

My image quilting program, quilting.cpp, takes 4 arguments: the sample texture, the block size, and the horizontal and vertical number of blocks in the image to be synthesized. My texture transfer program based on one iteration, texture.cpp, also takes 4 arguments: the underlying source image, overlying texture image, block size, and alpha value. My iterative texture transfer, transfer.cpp, takes no command line arguments and will run 5 iterations to generate pleasing transfers for the following three source/texture image combinations:

Cary Grant

with sand

A castle

with clover

Trees

with fabric

Results

Examples:

Image Quilting
Texture Transfer

I had a lot of fun playing with textures. In single iteration texture transfer, I noticed that block size had a much larger affect on the output image than alpha. Overall, I thought the iterative approach worked best. I followed the alpha values from the paper, and found 5 iterations to work well for my castle and the trees, but 3 and 4 iterations worked better for Mr. Grant most likely because the sand texture was so large. In my iterative approach I not only compared the texture blocks to the output of the last iteration, but I also compared the block to the original source image as well (i.e. after the first iteration I made two comparisons to calculate the overlap error for each texture block).

I also had some trouble getting my texture files to work on the suns. My Makefile will compile all the files, but Segmentation Faults may occur when they are executed. I found entering random cout comments helped the programs to run, an error that seemed totally bizarre and beyond my debugging prowess!

Links
quilting.cpp
texture.cpp
transfer.cpp
Makefile
path.h

 

 

Part 2: Texture Mapping

User Interface

Mouse Input

Move the mouse up/down to rotate the cube or sphere vertically (around the x-axis), left/right to rotate horizontally.

Keyboard Input

a: Move camera eye left
w: Move camera eye up
s: Move camera eye down
d: Move camera eye right
y: Rotate cube/sphere up
h: Rotate cube/sphere down
g: Rotate cube/sphere left
j: Rotate cube/sphere right
o: Reset Rotations back to center

In cube.cpp you may turn mip maps on and off by hitting the 'm' key.

It is also possible in sphere.cpp to switch between the following 5 display modes:

z: Wire frame of a sphere
Z: Displaced wire frame of a sphere
x: Solid filled sphere
X: Displaced solid filled sphere
c: Displaced globe of the earth

Links
cube.cpp
sphere.cpp
Makefile
path.h

Results

Cube with Mip Maps

Cube without Mip Maps

Wire frame of a sphere

Solid filled sphere

Displaced globe of the earth

Africa misbehaving

Implementation Issues
Cube:
My mip maps work fine on Windows, but I wasn't able to get them to work properly on the suns. My cube still works for non-mip map mode, but in mip map mode it appears that the lowest resolution mip map (1 x 1) is applied to every face.

Sphere:
The southern hemisphere of my globe is not textured properly. When I generate my vertices I think I a may be making them in a wrong order. The globe is still recognizable, some of the continents (South America, Africa) end up being "smeared" across large portions of the globe. As I concentrated most of my time on texture transfer, I did not have enough time to completely correct the problem. I also got one or two small rogue triangles around the South Pole that were purple and red, which may have been related to my problem.