Lab 3: Navigation and Specifying Geometry
CS 445: Computer Graphics, Fall 2008


[previous lab][schedule][next lab]

Goals


Directions

  1. In class, we discussed how to enable the viewer to navigate or "fly-through" a scene. The viewer uses controls (e.g. key presses) for 6 possible actions: move forward/backward, turn right/left, look up/down. Sample code for setting up the keypresses was sent out in email. In this first step, create a scene consisting of a large plane scattered with simple objects, e.g. glut cubes. Don't spend a lot of time on creating the scene and don't use so many objects that your system slows down. Your goal in this part is simply to implement and test the navigational system as described in class.

  2. Once you are certain your navigation controls are working, and before starting the next step, copy the VertexModeCubeExamples project over to your H drive (or wherever you are developing your programs) and run each of the four versions of code. Read through the code to make sure you understand what it is doing, as best you can. Yes, it can be a bit confusing!
  3. In this step, create a more complex scene for your navigation system without using glut or glu objects. That is, specify the vertices and colors explicitly using various opengl primitives. You need not specify the normals at this point (unless you want). Add enough complexity so that the navigation slows to a crawl when using immediate mode (glBegin/glEnd). To improve efficiency, compile your scene into a display list. To see how to do this, look at DisplayListCube.java in the VertexModeCubeExamples project. Does your program speed up or not?

  4. Convert your geometry to Vertex Arrays. Setting this up is a bit of work. To see how to do this, look at VertexArrayCube.java in the VertexModeCubeExamples project. How does timing change?

  5. Optional - implement vertex buffer objects (vbo). It isn't actually much more code once you have set up vertex arrays but the code can be confusing.

Deliverables: By class time on Oct 23: For the complex scene, place the jar file of each program version (immediate, display, vertex list, and (optional) vbo) on enfuzion. Email the corresponding zipped project code to gorr. Be prepared to discuss in class what you discovered.


[top]  [Schedule]  [Home]