Stay On Cone
by Yuri Kapulkin
Project Details
The official Stay On Cone website!

Stay On Cone was a graphics 471 project for Winter 2007. It was created as a game to test people's reflexes and ability to think ahead.

Stay On Cone was created in C++ using OpenGL. It exhibits lighting, texture mapping, hierarchical modeling, gravity modeling, and simple camera movements as well as matrix multiplications and rotations and translations.

A few different shapes are used in the program.
  • The cone is a gluCylinder with one base of size 0.
  • The ground on the top of the cone is created using GL_TRIANGLE_FAN.
  • The ball is a gluSphere.
  • The world is a gluSphere.
w-move ball away from you s-move ball towards you d-move ball to the right a-move ball to the left q-rotate camera to the left e-rotate camera to the right r-reset to beginning state with ball on top of the land and land standing up straight The rotation of the ground was done using a timer. Every time the timer went (every 1.5 seconds in the final release) a random number generator would generate the direction for the ground to pivot about the spike at the bottom. The rotations would then be kept track of using an object similar to the trackball

The gravity acting upon the ball was just modeled using the x and z coordinates of the normal of the ground plane. The gravity was applied to the ball every 50 milliseconds.

Camera rotations were done by just keeping the LookAt vector at (0,0,0) and by changing the eye vector based on the sin and cos of the angle.
Instructions
The object of the game is to keep the ball from falling off of the cone. This is done through camera rotation and affecting ball motion.

Commands
  • w-move ball away from you
  • s-move ball towards you
  • d-move ball to the right
  • a-move ball to the left
  • q-rotate camera to the left
  • e-rotate camera to the right
  • r-reset to beginning state with ball on top of the land and land standing up straight
Screenshots