Rebecca McKinley (rmmckinl) - CPE 471 Final Project
Introduction
This project simulates walking through a museum. It involves object placement, lighting, procedural texturing, image texturing, collision detection, and shadows. This small museum contains different kinds of items like statues, vases, and wall art. The user can walk around (with WASD keys) and view (with the mouse) the different objects in their lighting. There is also a flashlight that the user can turn on and off by hitting the 'F' key.
Video 1: Demo video . Please excuse the lagging camera and movement, my laptop had difficulty running program and video at the same time
Features
Figure 1: Overhead view of map
Description of Layout and Lights
Position #1
Bust of Napoleon on Pedestal
Single red spotlight directly overhead
Position #2
Statue of Mercury
Red and blue spotlights pointing an angle from the left and right of the statue
Position #3
Venus and Cupid
Green point light above
Position #4
Statue of a Nymph
Teal point light above
Position #5
Hunter and Dog
White spotlight above
Position #6
Wall Fresco
Two rotating spotlights located in the center of the second room
Position #7
Ancient Vase with image texture
Position #8
Standing Vase with image texture
Directional Light across whole scene
Turn on and off a forward-facing spotlight with 'F'
Movement
Move forward, left, back, and right with 'WASD' keys, respectively
Use the mouse to look around
Collision Detection
AABB collision detection keeps user inside the walls and keeps them from bumping into items
Procedurally Generated Marble
The statues have procedurally generated marble texture
Complex obj files I used did not have texture coordinates and adding them is difficult
A sine function of the x-coordinate would yield black and white stripes across the material
Also gives it an exponential falloff
Figure 2: Simple sine marble texture
Transform the sine from 0 to 1 and make it fall off more quickly with square roots
Then scale from 0.2 to 0.95 and reduce the blue component
Figure 3: Scaled 0 to 1 simple sine marble texture
A 3D noise function would yield more random marbling
Used a Perlin Noise function from openGL
Add a turbulence function that allows for multiple frequencies
Have a roughness factor for the jagged-ness of the marbling
Have an amplitude factor for the reaching of the marbling
Figure 4: Scaled sign with Perlin Noise and turbulence texture
Image Textures
Floor, wall, ceiling, and the wall art are all downloaded and applied textures
Shadows
All of the items have static shadows that are generated by flattening and darkening the object
Known Issues
There are bad texture coordinates on the item in position #8, something is corrupted in the obj file
There are some strange lighting things with the wall behind position #7 and #8
Almost looks as if there is another light interfering with that wall
Can only see it when it's hit by the spotlight, not the flashlight
Talked with Zoe about it in class and could not find a reason
Work around is to not have a spotlight in that area
The program takes a while to load initially because of the large obj files
The WASD keys have a slight lag due to the collision detection
The initial lookAt point is not valid and it looks (I believe) directly upwards
Work around is to move the mouse first in order to put it in the scene