Computer Graphics Lab
Spring 2015-2016 • CSE SW Lab FRI • 14:00-16:55


Assignments

No. Description Deadline
01. User gives two 3D points S and E with integer coordinates as input. Construct the 3D-DSS joining S and E and store the result as an obj file. Each voxel of 3D-DSS should be visualized as a unit cube whose center is an integer point.
View the obj file in meshlab.
Check whether your code produces output as in the following examples.
Example 1 (Δx = 5, Δy = 2, Δz = 1).
Example 2 (Δx = 37, Δy = 7, Δz = 5).
16-Jan-2016: 11 PM
02. User gives three 3D points A, B, C with integer coordinates as input. Construct the 3D digital triangle ABC and store the result as an obj file. Each voxel of of the triangle should be visualized as a unit cube whose center is an integer point.
View the obj file in meshlab.
NOTE: i) All variables should be integer variables. ii) Allowed operations: addition, subtraction, comparison, multiplication. No division or math library function should be used.
03. User gives an obj file as input. Each face in the obj file is either a 3D triangle or a 3D quadrilateral. Apply rotation in the object space, as specified the user. Now apply the back face culling and project the object on the view-port whose dimensions are also supplied by the user. You can use the Painter's Algorithm (link) for this. After projection, the entire image should be just fitting either the width or the height of the view-port with a 10-pixel margin on all sides. Save the result as an SVG file and view it in Firefox or some other web browser.

User input:
  1. obj file
  2. view-port dimensions
  3. camera coordinates
  4. angles of rotation about x-, y-, or/and z-axis. The axes should be local w.r.t. the object, considering (0,0,0) as the "center" of the 3D bounding box containing the object.
Examples: cube.obj & cube.svg

NOTE: See test.svg as a simple example. Open it also in a text editor to know how the vectors like line segments, circles, etc. are defined in an SVG.
For more details, see this website and wiki.

To submit in a zip (max 4 MB):
  1. source codes.
  2. README.txt containing instructions for compilation and execution.
  3. 4-5 svg files for cube.obj for different view positions with SVG image width / height from 300 to 500.
  4. 4-5 svg files for f16.obj (link) for different view positions with SVG image width / height from 300 to 1000.
04. Mini Projects pdf 31-Mar-2016: 11 PM


Meshlab

First login to the local machine.
Now login to the server of IP 10.5.18.90, using the following command:
ssh -X <login_name>@server_IP

To view an obj file in meshlab, use the following command:
meshlab &

OpenGL, GLUT, GLUI

Login to the server with IP 10.5.18.66 or 10.5.18.75 after login to the local machine, as explained above.
After server login, you may copy the example files from the servers. For this, use the following commands:
cp -r /usr/local/glui-2.36/src/example .
cd example

For compiling, use the following command:
./Compile <prog_name.cpp> <prog_name.out>

Installation (In UBUNTU)
With internet connection ON, just execute the following statements in sequence:
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install freeglut3 freeglut3-dev
sudo apt-get install libXi-dev
sudo apt-get install libXmu-dev

Sample Code
pb1.cpp

OpenGL Resources
OpenGL tutorial | OpenGL wiki

Softwares

Bunny Logo   SVG Logo   Blender Logo   Meshlab Logo   Inkscape Logo   Gimp Logo   Real Time Rendering Logo  

2D & 3D Objects

You can right-click on the link and then save it.
  1. 2D objects: 85 silhouette images
  2. 3D integer point set: zip of 4 files
  3. 3D OBJ files
    mug   mug   mug   mug   mug  

  4. PLY files
    airplane | apple | bunny: large | medium | small | tiny | canstick | cow | cube | cube-twisted | dodecahedron |
    flowervase | fighter plane f16 | p20 | p120 | kerosene lamp | ladybird | mug | pickup van | stratocaster | street lamp |
    table | table 2 | teapot | testa | toy plane | trashcan | turbine | vase
    All files zip