HOME RUN DERBY

Joe Kriege

CSC 471

Final Project Spring 2005

This project is an implementation of a 3-D "home run derby" real-time game.  The concept of the game is as follows:  you have ten outs to hit as many home runs as you can, your out (pitch) count is not decremented if you hit a home run, otherwise you lose an out every at bat; the results are relayed to the dos output screen.  A texture-map of a baseball field is used, as well as several texture maps of a crowd to create the feel of a baseball stadium environment.  A texture map of a baseball is used on a sphere and three different wood textures (as can be chosen) on a cylinder to create the image of a realistic baseball and baseball bat.  The dimensions for the displayed baseball field are meant to be close to about a foot per pixel, with the exception of the baseball mound which is, unrealistically, about 85 feet away from home plate.  Currently, the pitcher is a stationary ball, and the hitter is a stationary bat (angled as if being held by a person); the buttons for hitting and pitching the ball are described below.  Collision detecting is used to determine if the pitch hits the bat or not, and from there kinematic physics equations (with gravity as a downward acceleration constant) to determine the motion of the ball from the result angle and velocity of the ball-bat contact.  Before contact, the bat and ball are both assumed to have a constant velocity, as well as a constant mass, all of which are used with conservation of momentum to determine the result velocity of the collision.  If the ball reaches a certain distance before touching ground, it is considered a HR (usually a fair ball that reaches the crowd), everything else (including whiffs) is considered an "out" and you lose a pitch. 

SPACEBAR --- pitches ball
'h' --- regular swing
'H' or 'p' --- power swing
UP_ARROW + swing --- high swing
DOWN_ARROW + swing --- low swing
ENTER --- bat and pitch back to origin
's' or 'S' --- toggle sound
'b' or 'B' --- toggle ball camera (for pitching)
ESC --- exit game

RIGHT_CLICK -- get menus to toggle bat texture and pitch speed

SCREENSHOTS