Inf4 Computer Graphics Practical #2, 2011
Ground Rules for practicals:
- Feel free to discuss problems and approaches to your practical
with others.
- The design and code must be your own.
- Cite any code reuse, ideas or algorithms that you do not
develop yourself, in comments at the head of your code or
in a README file.
- The deadline for the practical is 11:59pm on
Monday 5th December 2011.
- Submit your practical electronically using the Informatics
submit procedure. Your submission will be timestamped.
Here is a brief statement of your deliverable for this practical:
You must write a program to draw the teapot over the floor.
I previously uploaded a demo program that loads this .obj data format
to here. You may use this for loading the
data.
You must import the provided data from the above links.
You *CANNOT* use the 3D rendering functions of OpenGL to render the objects.
You must write a program that does the illumination, shading and rasterization.
-
You must first compute the normal vectors at each vertex by averaging the
normals of the triangles that surrounds the vertex. Therefore, you must
first scan all the triangles and produce a list of surrounding triangles
for each vertex.
- You can either use Gouraud shading or Phong shading.
- If you are using
Gouraud shading, you should do the lighting computation at each vertex
using the normal vectors computed at the previous step. Then, you should
colour the pixels within each triangle. You can compute the barycentric
coordinates of each pixel centre, and interpolate the colour of the triangle
vertices.
-
If you are using Phong shading, you will interpolate the normal
vectors of the triangle vertices to comptue the normal vector at
each pixel centre. Then, you will do the lighting computation
at each pixel centre.
- The floor can be simply composed of two large triangles.
- The assignment can be done in a similar way as you did the first
assignemnt. You scan through all the triangles, like you did for drawing
the triangle edges, and instead, you fill in the pixels of the triangles.
Here are the additional bonus mark items:
- Using bump, light and displacement maps
- texture mapping, projective textures
- Anti-aliasing
- Adding shadows
- Adding mirrors
- Adding environment maps
- Adding reflection / refraction effects
- or any other extension that you learned at class
Ensure you manage your time carefully. Submit all files required by the
marker to compile and run your code.
Assessment
This practical is designed to test and enhance your learning of the
topics covered in the second section of the course.
Your mark for this practical contributes 15% of your course mark. You will
receive a mark out of 100. I urge you to plan your time carefully and not
spend much more time than that suggested.
You also need to attach a README file that briefly explains about your
program and what you have done.
Completion of the stated deliverable will earn a mark in the region of 70%
60% for MSc students).
Taku Komura, November 2011