My final project was based primarily on the interaction between my hierarchically modeled penguins and the person controlling the camera. The object of the game is to infect all the penguins and turn them gold.
The two major forms of collision detection that happen are between the camera and the penguins, and the camera/penguins to the bounding room.
When you approach the penguins for the first time, they change materials to a gold color (Midas touch) and turn and run away. He will also keep running from you if you chase him until he reaches a certain distance away and feels safe enough to stop running. As the penguins are running, they turn and face a different direction to run away. Sometimes they run away facing a normal direction, but sometimes if you run up and startle them well enough, they'll moonwalk away from you - A feature not a bug?
The penguins and camera are bound to the confining box, also using collision detection. The room is a cube .obj scaled to the desired size, and the penguins and camera stay within a certain x and z boundary. The camera simply can't pass through the cube, but the penguins will collide with the wall and change directions to one that's reflected about the wall's normal. I think there's a glm call for this, but I couldn't get it to work, so I just created them all by hand.
Herd ALL THE PENGUINS!
|Just as a smaller feature, I added a timer that times how long it takes you to infect all of the penguins and displays a message.|