CPE 471 Final Project: 3D Engine
By Luke Winkenbach
A 3D graphics engine is the framework behind any 3D game. Big game software companies like id, and Valve create complex 3D engines for their games, and smaller software companies will license these big engines to create their own games. It was my goal to make a simplified 3D graphics engine, and incorporate as many aspects of a good engine as I could.
Program Description
This program is a quick demonstration of the 3D engine I created for this project. It involved two 2 rooms connected by two different hallways. The user move around this world in a first person perspective similar to games like quake, doom, and half-life. The features of the 3D engine are shown below:
- Collision Detection: The user cannot pass through any walls, or the table. The collision detection not only keeps the user from passing through the walls, but it also responds to the collision by allowing the user to "slide" along the walls instead of just being stuck to them. This was necessary in order to create a natural feel.
- Lightmap Shading: OpenGL's lighting has a cap set at 8 lights. This doesn't work for a large map, so it's necessary to find another way around this. This 3D engine uses lightmaps to create greyscale textures to perform the shading. A texture is created for every polygon in the world, and then it is blended onto the original texture to create the shaded effect.
- Shadows: OpenGL has no built in way to do shadows, so the light engine I created to create the lightmaps had to be modifed to create shadows as well. This was done by placing the shadows on the polygon's lightmap, so that it appeared when it was rendered.
- Movement: A flexible camera class was created to give the effect of the user walking around in the world. The camera can move forwards, and backwards. It can strafe left and right, and it can look in any direction.
Program Usage
The usage is very similar to most first person games. Movement is done with the 'w' and 's' keys for moving back and forwards, and the 'a' and 'd' keys for strafing left and right. Looking is done with the mouse.
Screen Shots
Here we can see a table in a room. Notice the shadow casted by the table, and the shading on the walls.
Here we are looking down a hallway. Notice how the walls make the hallway dark, but light can spill in from the rooms.
References
Here is a list of sites I used for references for different aspects of the engine.