Project goal: To design and implement a happening bar and a simple outside world with the new element of textures.
There is a door that opens both in and out with the pressing
of the 'o' and 'O' keys respectively
that the user can use to transition between the inside and outside world.
The user can also enjoy the day outside and then toggle to "night
mode" via the 'n' button.
In "night mode" the day time sky of clouds and sun switches to a
night sky of stars and moon,
while the bar dims to show the colored spotlights embedded in the ceiling.
Outcome: goal met!
Here are the steps I
took to design this project in order of their implementation:
i. Create the room (i.e. walls, ceiling and floor) and set up lighting
ii. Incorporate textures on the walls, floor and ceiling.
iii. Put in a disco ball
iv. Design and implement a bar counter area and texture it with wood
v. Design and implement chairs for the bar
vi. Design and implement cocktail tables and stools
vii. Implement the arrow keys for movement around the room and u and d for looking up and down respectively.
viii. Implement y and Y to move the viewer up and down the y axis, this was mostly to be able to find objects while debugging , say if I placed a wall below my scene I could go look for it and decide what exactly I was doing wrong based on where it ended up. I kept the functionality because I thought it was interesting.
ix. Apply textures for dance floor and picture of my kitties on the walls
x. Design and implement couches.
xi. Reposition an adjust values of lights so that they give the desired spotlighting effects in the desired areas.
xii. Redesign the wall on the positive x axis so that I can incorporate a door that opens to the outside world
xiii. Apply a textured door that opens and closes with the o and O buttons respectively.
xiv. Draw a lawn outside
xv. Draw a sky outside
xvi. Implement a light at the sun
xvii. Design and implement some trees
xviii. Make it so that you can toggle night and day with the n key. i.e. if it is night texture the sky with stars and make the outside light a white moon spotlight, all lights in the bar are positional spotlights. If it is day, texture the sky with clouds and make all lighting(outside and in) directional such that the whole scene, in and outside the bar is lit brightly, as it would be in the daytime.
Troubles:
For me, textures had a steep learning curve. It took a while for me to figure out just where the texture enabling and disabling should be such that objects without textures are not affected by objects with textures. It also took a minute to figure out when to use modulate mode and when to use decal mode. Basically for anything on top of my brick textured walls, or checkered floors, I had to use decal to ensure true colors. Other than that I had no real problems, just some trial and error with rotations and translations of surfaces to maintain proper orientation of textures. I implemented the y and Y options to help me with this.
Here are the keys
that control the execution/movement of my program:
Arrow keys control viewpoint.
Press "right arrow" to turn the viewpoint to the right
Press "left arrow" to turn the viewpoint to the left
Press "up arrow" to walk forward in the scene in the current direction you are facing in the x-z plane.
Press "down arrow" to walk backwards in the scene in the current direction you are facing in the x-z plane.
Press "d" to look down.
Press "u" to look up.
Press "o" to open the door.
Press "O" to close the door
Press "n" to toggle day or night
Press "s" to toggle smooth and flat shading
Press "y" to move camera up y axis
Press "Y" to move camera down y axis
Press "1" to toggle the red disco ball light
Press "2" to toggle the white center light
Press "3" to toggle the blue light over the tables
Press "4" to toggle the green light over the couches
Press "5" to toggle the yellow light over the bar
Press "6" to toggle the teal light over the disco ball
Algorithms and Techniques: I can not think of any special algorithms that I used. The furniture was of my own design and most accomplished via trial and error as far as where to place legs etc. The idea for movement around the room I got from Nehes site under
openGl tutorials on the openGl webpage.
Errata on the Kitties:
The cats pictured in the bar are the loves of my life. The orange cat is the fierce and brave Lil Bro and I own him. The gray kitty near the door is Isaac and he and the black and white kitty near the bar (Lulu) belong to my roomie Megan. The handsome white and gray cat by the disco ball belongs to my boyfriend Roman and his name is Karl, named after a fellow from the music group Kraftwerk.