Hierarchical Hand Playing Piano

Samantha Hsu | CPE 471 | Fall 2017



For my final project, I expanded my experience with hierarchical modeling by hierarchically modeling a hand playing an octave of a piano.

Modeling Specifics:
- The white keys of the piano are modeled with two cubes - one scaled to be thinner in x to be the "thin" part of the white key, and the other "fatter" part of the key is a cube scaled appropriately and then placed with respect to the thin part. The black keys are scaled to be long in the z direction and thin in the x direction, and translated slightly up the y axis to be higher than the white keys.
- The hand is modeled with spheres. Each finger is composed of 3 sections, and the thumb is composed of 2. The fingers rotate from their base joints from the base of the hand.
- Each key on the piano is mapped to a key on the keyboard (except for the last black key - I drew this to make the model of the piano look more complete) - You can view the piano-hand model from different angles via certain key controls.

I used my own personal judgement to determine which fingers would play what keys, depending on:
- If the key selected to be pressed is the first key selected since starting the program.
- If any keys to the left or right of the selected key have been played, and if so, what finger played the previously selected key(s).
- The actual key itself. Specifically, where it is on the piano - for instance, it wouldn't make sense to have the thumb play the 2nd C key, just like it wouldn't make sense to have the pinky finger play any of the first few keys on the left of the piano.

The hand moves forward down the negative z direction to reach the black keys. It also moves to try to set up for the next key to be played.


Controls

Piano Key Mapping (keyboard key -> piano key)

A - (1st) C key
W - C# / Dflat key
S - D key
E - D# / Eflat key
D - E key
F - F key
T - F# / Gflat key
G - G key
Y - G# / Aflat key
H - A key
U - A# / Bflat key
J - B key
K - (2nd) C key

Moving through scene/Moving model

LEFT - move left
RIGHT - move right
UP - move up (y axis)
DOWN - move down (negative y axis)
SPACE - move forward
BACKSPACE - move backward
R - rotate model clockwise around y axis
L - rotate model counterclockwise around y axis
ENTER - rotate model counterclockwise around z axis
(RIGHT) SHIFT (under ENTER key) - rotate model clockwise around z axis

back

Middle finger pressing F key


back

Ring finger pressing F# / Gflat key


back

Ring finger pressing B key


back

Side view of model


left

Side view of thumb pressing the (1st) C key