------------------------------------------------------------------------------ Reading object from file "objects/cube.off" -> ------------------------------------------------------------------------------ Camera Origin = [10,10,10] Camera facing towards [0,0,0] Focal length of camera = 3 Number of vertices = 8 Number of edges = 12 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Mapping from World co-ordinates to Image plane co-ordinates: ------------------------------------------------------------------------------ (0,0,0) => [128,128] (0,0,1) => [128,105] (0,1,0) => [147,139] (1,0,0) => [108,139] (1,1,1) => [128,128] (1,1,0) => [128,151] (1,0,1) => [107,116] (0,1,1) => [148,116] ------------------------------------------------------------------------------ Writing 256x256 image to file "view.ppm"...done!
The results of the four OFF objects show the potential of the 3D image
mapping program. For the purpose of the assignment, we only had to
display a simple cube, but the idea can be easily extended to include
very complex objects as well.
The file offobject.h is the header file for the class of functions for reading, writing and manipulating the 3D object data (C++).
The file offobject.cc is the
implementation file for the class of functions for reading, writing
and manipulating the 3D object data (C++).
The file matrix.h is the header file for
the class of functions for matrix operations (C++).
The file matrix.cc is the
implementation file for the class of functions for matrix operations (C++).
The file image.h is the header file for
the class of functions for image manipulation (C++).
The file image.cc is the implementation
file for the class of functions for image manipulation (C++).
The file main.cc is the main driving routine for this project (C++).
Note: Special run scripts are necessary to execute the code.
For a complete copy of the code, scripts, and objects, click here.
After you have downloaded the file:
Binary for SunOS: proj3sunOS
All images are 256 x 256.
Figure 1: Original object (cube.off)
with camera origin at [10,10,10] Figure 2: Same object (cube2.off) with
camera origin shifted to [7,5,3]
Figure 3: Example object: mushroom.off
Figure 4: Example object: pear.off
Figure 5: Example object: teapot.off
Figure 6: Example object: space_station.off
Source code:
gunzip -c project3.tar.gz | tar -xvf -"
./run objects/[object-data]" to execute the code
Binary:
Binary for Linux: proj3linux