Docsity

Mesh Loading - Introduction: Computer Graphics - Assignment 7 | CS 470, Assignments of Computer Graphics

Toggle sidebar
bg1
Homework 7 : Due Oct. 25, 2006
CS 470
October 18, 2006
1 Mesh loading
The goal of this section is to load a model from an external file (ply format) and compute normal
vectors for flat shading.
You will create an interactive 3D application with the following features:
•10% - Open a 512 ×512 window. The text in the titlebar should read ’Homework 7’. The
background color should be black, and the frame buffer should contain a depth buffer for
hidden surface removal. Render your name in the lower left hand corner and a frames per
second counter in the lower right. Render the scene using perspective projection and the
camera2d camera model and controls from homework 6.
•10% Load the dinosaur1850.ply mesh. When the function key F1 is pressed display the the
vertices of the mesh as GL_POINTS. Apply a scale transformation to the mesh when rendering
so that the mesh always fits inside a 10 ×10 ×10 box.
•20% When the function key F2 is pressed display (using a vertex array) the triangular faces
of the mesh (GL_TRIANGLES) in red with ambient color red (no normals needed).
•20% Compute the face normals of each triangle. When F3 is pressed display the mesh as a flat
shaded triangle mesh using the lighting described in the next section. The rendering should
be done through a vertex array.
•10% Documentation.
2 Materials and lighting
The goal of this section is to gain experience specifying light and material properties in OpenGL.
•10% By default, render the lit mesh with ambient color black, diffuse color blue and specular
color black.
•10% When F3 is pressed a second time, change the mesh material to ambient color black,
diffuse color green and specular color white with specular exponent = 75.
•10% Add a rotating light source to the scene. Create a point light source and make it rotate
about the z-axis in a circle centered at (5,5,5). The ambient, diffuse and specular colors should
all be white.
3 Extra Credit
For extra credit, add planar shadows and reflections to the scene.
•+5% Render planar shadows on the ground plane using the shadow matrix discussed in class.
1
pf2

Partial preview of the text

Download Mesh Loading - Introduction: Computer Graphics - Assignment 7 | CS 470 and more Assignments Computer Graphics in PDF only on Docsity!

Homework 7 : Due Oct. 25, 2006

CS 470

October 18, 2006

1 Mesh loading

The goal of this section is to load a model from an external file (ply format) and compute normal vectors for flat shading.

You will create an interactive 3D application with the following features:

  • 10% - Open a 512 × 512 window. The text in the titlebar should read ’Homework 7’. The background color should be black, and the frame buffer should contain a depth buffer for hidden surface removal. Render your name in the lower left hand corner and a frames per second counter in the lower right. Render the scene using perspective projection and the camera2d camera model and controls from homework 6.
  • 10% Load the dinosaur1850.ply mesh. When the function key F1 is pressed display the the vertices of the mesh as GL_POINTS. Apply a scale transformation to the mesh when rendering so that the mesh always fits inside a 10 × 10 × 10 box.
  • 20% When the function key F2 is pressed display (using a vertex array) the triangular faces of the mesh (GL_TRIANGLES) in red with ambient color red (no normals needed).
  • 20% Compute the face normals of each triangle. When F3 is pressed display the mesh as a flat shaded triangle mesh using the lighting described in the next section. The rendering should be done through a vertex array.
  • 10% Documentation.

2 Materials and lighting

The goal of this section is to gain experience specifying light and material properties in OpenGL.

  • 10% By default, render the lit mesh with ambient color black, diffuse color blue and specular color black.
  • 10% When F3 is pressed a second time, change the mesh material to ambient color black, diffuse color green and specular color white with specular exponent = 75.
  • 10% Add a rotating light source to the scene. Create a point light source and make it rotate about the z-axis in a circle centered at (5,5,5). The ambient, diffuse and specular colors should all be white.

3 Extra Credit

For extra credit, add planar shadows and reflections to the scene.

  • +5% Render planar shadows on the ground plane using the shadow matrix discussed in class.
  • +5% Render planar reflections about the ground plane using the reflection matrix discussed in class.

Either full or zero credit will be given for each of these specifications. Hints: You may share / download code only for loading the ply file. Some helpful links: http://local.wasp.uwa.edu.au/~pbourke/dataformats/ply/ http://www-static.cc.gatech.edu/projects/large_models/ply.html http://www.cs.princeton.edu/~diego/professional/rply/

4 What to turn in

Submit all source code, a README file, and a working project file or Makefile which builds an executable named ’hw7’ or ’hw7.exe’. Turn in a single tarred and gzipped, or zipped file by the start of class on the due date. Electronic submissions should be made through vista.wvu.edu.