This project built on project 4 some more. It concentrated on doing animation in the 3D scene. I think it would have been a good application of the stencil buffer too, but I had no luck making my code work.
This project used the same scen in Project 3/4. I added a run-way and a small plane made of quadrics.
The interface is nearly the same as Project 4. I added the abilitie to view the scene from the plane view and from a slightly distant location. There is also the ability to make the plane take off and land.
To interact with the scene, the user must use the moust buttons. If the left mouse button is held down and the mouse is moved left and right, the scene rotates in the +/- Y direction.
If the left mouse button is held down and the mouse is moved up and down, the scene rotates in the +/- X direction.
If the middle mouse button is held down and the mouse is moved left/right, the scene is also translated left/right. Middle and up/down move the scene up and down.
Finally, if the right mouse button is held down and the mouse is moved left or right, the scene rotates on the Z axis. Right mouse button and up/down scale the scene (but, the scaling factor is divided down by 100, so it doesn't scale very well. This is to prevent the scaling from rapidly getting out off hand).
There is also an option to switch between a perspective and orthographic view.
Texture mapping is also enabled. If the program is run from an O2 or Indigo2 with Maximum IMPACT graphics, texture mapping is turned on by default. However, running on an Indy or Indigo2 with less than Max IMPACT turns texture mapping off since it is a serious effort on those machines to do the texture mapping. Note: If you 'run' the program on an Indy and display it somewhere else, texture mapping is still going to be turned off. I am not sure if OpenGL provides some functionality to determine the specifications of the machine on the remote end of a dgld process)
The textures are all 64x64 RGB files. They tend to show up rather dark on lab O2s and rather light on my Indigo. I don't know why that is.
This project also introduced lighting and material properties. My scene has a single ambient light. Most of the house materials have a relatively high reflective material just so I could make sure the light was working. The 'backs' of the polygons have a much more matte finish (as can be seen if the scene is rotated to look through the windows of the house with opacity set very low)
The project also provides a method of drawing solids of revolution.
To draw a new solid, set the depth (Z value) and axis (distance from the first point to the rotation axis) and then click new polygon. The scene changes to a top down perspective. You can select a front or side perspective too, but currently only the top-down view actually works. The others assume the top-down view is used, even if it isn't.
Clicking a few points and then hitting 'End Polygon' will cause the I want it to. I am not sure why the spacing is so extreme between the objects.
Unfortunately, I don't feel I implemented this project nearly as well as I'd like. Even with the large time investment, I don't feel I completed the project very well. Balancing what needed done on Project 4 with the extensions for project 5 didn't make either one go very smoothly.
The code is here
Anyway, screenshots are below.
Figure 1: The Initial Program Appearance (click to enlarge)
Figure 2: The scene rotated with the plane still flying around (click to enlarge)
Figure 3: The plane flying around. (click to enlarge)