I'm very passionate about playing fighting games like Street Fighter or Marvel VS. Capcom, so I wanted to do something similar. I know fighting games have simple hitboxes as displayed here, so I was hoping to do something of that sort. I quickly figured out that animating models using just openGL is a much harder task. In addition, doing things like collision detection was troublesome. I understood the math behind it but the actual implementation gave me trouble. Rather than be ambitious and create a simple fighting game, I created a simple person out of cubes that can do a funky kick or punch (not realistic at all) and a punching bag that stays in place until a punch or kick is done.
I was unfortunately not able to implement collision detection in the end. I get the methods of doing it like using a bounding box or bounding spheres. Specifically, with bounding spheres I understand if the combined radii from the center of say the fist of my model and the center of the punching bag is greater than distance of both centers from each other, then there is a collision. Unfortunately, I was unsure of how to implement it.
I ended up making a simple heirarchical model for a person using cube objects. It's composed of two arms, two legs, a head, torso, and hips.
The legs are composed of an upper leg, a lower leg, and a foot. The lower leg is relative to the upper leg, and the foot is relative to the lower leg.
The arms are composed of an upper arm, a lower arm, and a hand. The lower arm is relative to the upper arm, and the hand is relative to the lower arm.
The legs and torso are relative to the hips.
The head and arms are relative to the torso.
The punching bag is also a simple heirarchical model, but made up of 5 sphere objects, and 1 cylinder object.
At the top there is a ball that everything hangs off of and the rest of the objects are relative to that.
I made simple ropes out of elongated spheres.
I used a simple cylinder as the bag since it resembles it.