Final Project - CSE 167 - Student: Jeremy Pollock
Comments
My project is a set of hands that illustrate on screen any key-strikes on the
keyboard. Put simply, they're typing hands that copy on screen whatever the user
types on the keyboard. The code that implements this project is, while not
complex, fairly long and involved. A quick breakdown is as follows:
*two sets of arrays control the movement of the fingers.
XYKnuckles[] (where x is left or right and Y is one of the fingers) is an array of
three floats which represent the angles at each knuckle. changes in these angles
cause the fingers to bend and or flex. XHandFlex[] is the control array for finger
movement. because openGL is event-driven and key strike is actually a sequence of
events (not an instantaneous event), XHandFlex holds onto a series of ints that
each correspond to the sequence number of movements for a given finger. these
counters are continually decremented. while positive, the int forces movement on
the finger via the moveALLfingers() function. once the ints cross the zero-
threshold to negative values, the fingers begin to recover and resume their natural
state.
*in order to simplify a LOT of code, I arranged drawing
hierarchically. there is a drawHand function, which calls functions that draw
fingers, which call functions that draw carpals and knuckles and so on. this
eliminates a lot of clutter that would otherwise make this project impossible to
read through.
*all general keys are mapped to the typing hands. test out the
program and see. nearly all keys on the keyboard are bound to a particular finger.
I did not go so far as to create seperate keystrikes for the top, middle and bottom
row. they're all the same. if you're using the index finger to type a key, the
index finger strikes.
*its worth nothing that I included the option to turn on either
front or back culling. in order to produce two identical hands, I merely did a
negative glScale() across the z axis, mirroring the left hand to produce a right
hand. scaling the hand in this fashion however, reversed the faces such that
culling back faces exposes the wireframe of the right hand whereas culling front
faces exposes the wireframe of the left hand.
There is no magic to running my program, load it up in VC++ and press .
Arrow keys control camera viewpoint. "F1" toggles culling of front faces as
explained above. "F2" toggles culling of back faces. "F3" toggles wireframe mode.
"F4" is used to zoom in and "F5" is used to zoon out. All other general keyboard
keys are bound to the modeled hands.
List of figures
finalProject.exe