CMPS160, Fall 2013, Section 01: Lab 3 Terrain Rendering

Lab 3- Terrain Rendering:

 

Description

This lab will introduce you to geometry generation using height field maps, texturing, and camera-world interaction. Many games and virtual worlds include some model of terrain. The terrain is either created procedurally or by hand. See below for more detailed implementation requirements. The lab is graded out of 70 points, with a maximum score of 75/70.

Starter Code

Useful OGL Functions

glVertex3f()
glBegin(GL_TRIANGLES)
glEnd()


(Appendix D in the back of your class textbook)
Viewing: D.1
Vertex Buffer Objects: D.2
Texture Mapping: D.5

various glLight* functions

Resources

  • Included in the starter code:

Criteria: (For Grade)

ValueDescription
5 Load height field and texture skin ppm from command line as an argument
5 Generate terrain geometry using the provided height field map
5 Apply the texture to the terrain
5 Option to generate face normals based on height map geometry
10 Option to generate vertex normals based on the height map (should look visibly different than the face normals) (try lowering the resolution of the input terrain file to make this more obvious)
5 Light the scene with 1 stationary light (once you turn on lighting, you MUST specify normals to OpenGL)
10 Provide some way to move the light around with visible effect
5 Use a display list or VBOs (Vertex Buffer Objects) to cache height field geometry (and have option to turn this on and off)
10 Add controls to change viewpoint and field of view and move around the terrain
5 Display a help message about what the mouse and keyboard do
5 Add option to control the near/far planes and see how the rendering changes when they are set too close or too far
5 Program does not crash

Attachments

  • lab3.zip, application/zip, 9,534,650 bytes