Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

i am creating my 3d game engine using Opengl.

this question might sound stupid to you but i am still in the process of learning, i have a 3d animated girl that slaps guys of different talls on the face.

however the animation is specified for a tall say 1.85CM. when i want her to slap a guy that is 1.60CM tall then she slaps the space over his head.

do i have to create animations for the girl slapping different talls of guys?!

this would be a lot of work, i hope you give me some insight about how such thing are handled.

also could you please give me some resource on generating animations in runtime?

to get my idea for example take a game like fight night, a head punch would be directed to the head no mater how the tall of the other guy is.

share|improve this question
4  
A very general though hard to implement approach is using inverse kinematics. –  danijar Apr 3 '13 at 19:02
add comment

2 Answers

up vote 4 down vote accepted

Technique you are searching for might be Inverse Kinematics. In short the input is the desired global pose of single joint (hand of your woman slapping 1.6m guy) which is the end effector. You solve for the local poses of other joints in your animation that will bring the end effector to desired location.

It's explained in detail in Jason's Weber article called "Constrained Inverse Kinematics" in this book. Unfortunatelly I don't know of any good web articles but it might give you an idea what to search for.

share|improve this answer
add comment

If it is just for this single situation of slapping faces, you could simply overwrite the shoulder pitch angle. You could probably work out what it should be with some simple trig, but I would just find values empirically for each male. Of course a full inverse kinematics solver is better, but if your cases are so limited, a simple hack is a better option.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.