CSC 471 FINAL
PROJECT – DRIVING RANGE SIMULATOR
by Sean Dinsmore
This program is a simple golf swing generator. Using the mouse, you can swing the driver
and hit a ball, while finding out how far you hit
it and with what kind of shape (hook or slice). The environment was created using texture maps, while the objects of the world (such as the tray of
balls, golf club and the tee) were
made using glu Objects. As with all
great golfers, this one hits the ball left-handed.
Swing Creation
The
golf swing was modeled after a realistic golf swing. If you look carefully at the swing, you can see that it is very
near a ‘perfect’ golf
swing; that is, it is always on plane, the club
face is square to the swing arc, and the club is parallel to the ground and to
the target line at the top
of the swing.
To create the swing, 5 different rotations were used, around 3 different
centers of rotation. These rotations
are the body
rotation (around the spine), wrist cock (hold your
hands together and bend your wrists up), wrist ‘slide’ (hold your hands
together and move them
both to the left), wrist rotation (around your
forearms), and arm lift. To make the
swing appear realistic, all these rotations must have a certain
scale, and more importantly, happen in a certain
order at correct times. The downswing
was modeled the same as the backswing, except that
the rotations went on longer in order to simulate
a follow through.
Ball Flight and Trajectory
Ball
flight was created by setting the ball on a circular path. Only part of the circle was used, though,
from 45 degrees to 135 degrees.
This way, the ball started out on a straighter
path instead of a more circular path (from 0 to 180 degrees). Also, the trajectory was stretched
using a 4x4 matrix. Shape was added to the shot by rotating the ‘circle’ around the
z-axis, thus having the ball curve yet end up in the middle
of the fairway.
This is exactly the same behavior a real golf ball would have if it was
hit from an inside/outside swing path with a square
club face.
Swing Variations
While using this
program, you may notice that no two swings/results are ever the same. This is because while taking the club back
with the mouse,
if there is any lateral movement with the mouse,
the club with be pushed/pulled outside/inside the optimal swing path. This will create a slice or a hook.
To hit the ball the farthest, you must take the
club straight back (no lateral mouse movement) the farthest it will go.
Program Usage
There
are many options in this program. To
view a swing without actually hitting the ball, hold down the right mouse
button and move the mouse
back and forth.
Releasing the mouse will reset the club to the original position. To hit the ball, drag the club back with the
mouse while holding down
the left mouse button. To initiate the downswing, either release the left mouse button
or simply move the mouse forward. You
can move the camera
around by holding down the middle mouse button and
moving the mouse around. To zoom the
mouse, use the +/- keys on the keyboard.
To view a
perfect swing performed by the computer, press the
‘a’ key. All shot results will be
displayed on the console after the ball has landed.
Top of the Swing
Top of the Swing viewed from above
Follow-Through Viewed from the Front
Bombed!
No Outside References Were Used Besides Lecture Notes and a few Website Code Samples for the Animation Timer