Cave Exploror Simulator
In this project, I created a textured cave using both wild .obj files as well as objects I built myself using cubes and spheres.
The overgrown goblin cave entrance.
Columns from the cave looking up at the stalactites on the ceiling. Both are created in clusters.
- Hierarchically modeled character and cave components
- Splitting multi-shape .obj files into individual shapes with multiple textures, specifically the brush and mountain plane surrounding the cave entrance.
- Blinn-Phong point and directional lighting. A direction light gives the cave low-level lighting, and a point-light from the character is applied as increased lighting to the scene.
- Textures are applied to all elements within the scene besides the character.
- Movable camera with 360° rotation.
- Wild objects didn't initially have normals, and others didn't have texture coordinates, forcing me to re-build them in Blender once I had figured out the solution.
- Finding a way to set up the cav's interior was difficult, and required experimenting to see what part of the sphere should be discarded in the fragmetn shader.
- Distance attenuiation for the character's torchlihgt was attempted, but ultimately after experimenting the torchlight within on the character within the cave looked more distance based without modification.
Torchlight From Character
Using objects with multiple shapes
Once I had gotten object texturing to work, a big challenge was dealing with the multiple shapes within the goblin cave file. I ended up going into Blender and deleting hundreds of shapes that I didn't care about within the file in order to isolate the ones that I cared about. Once found, I was able to modify the Shapes.cpp file to take in indices of shapes so that I could divide and heirarchically model them.
Although I had planned on further features, namely merging the character movement with the camera, I like the way my cave explorer simulation turned out. In hindsight, I probably could've done more if I had created one unified cave scene in Maya or Blender using the other objects, then put that into OpenGl and focus more on lighting and collision-detectiong. However, since now I can easily throw in as many stalagmites, stalctites or columns as I want, there is potential for an infinite cave to be generated, so I have a direction to move from here.
Note: If submitted code does not compile after build, remove lines 48-61 from GLTextureWriter.cpp. For whatever reason this issue occurred on one machine after submission, but not on the machine I built the project with.
In a Unix terminal a new build directory:
- To run:
In Windows machine set up to run visual studio, simply run the solution in the build directory.
- Move the mouse to control the camera direction
- W, A, S, D - move camera forward, left, backward, and right respectively
- I, J, K, L - move character with torchlight in the X and Z planes.