Inverse Kinematics, Character animation, direct3d tutorials...

Started by
7 comments, last by ByteMe95 22 years, 6 months ago
I have a bunch of questions, so I figured I''d throw them all into one post. I recently subscribed to GD magazine and all I see and hear about is inverse kinematics. From what I can understand from my readnig is that it has something to do with character animation, but i dont really know what, anyone know?? secondly, what is the best way/ how is character animation is done. From what I know u load a 3d model with pre-set key frames and interpolate through them (I''ve never done any of these things but would love to at some point). And does anyone know where there are good direct3d tutorials out there, I cant find any good ones, only on DX8 though! I am new to the 3d world, I have a pretty god understandign of it and have practiced a bit in opengl, but would like to finally learn d3d now (I know older versions of dx with ddraw pretty much perfectly). If anyone can answer any or all qwuestions feel free. I dont expect detailed answers at all, just generally so I can understand it. Let me throw a couple more questions in actually: vertex/pixel shaders, what are they EXACTLY? I kind of know, but then when u speak of rpogrammable vertex/pixel shaders I have no idea what that is. OOOOH, almost forgot, what the hell does the stencil buffer do and how does it work/what is it used for? What is a mesh deformation/what is it used for? and i think that should do for now. Thanks - Rob ByteMe95::~ByteMe95() Cerebrum Software
ByteMe95::~ByteMe95()My S(h)ite
Advertisement
You ask too many questions...

IK = Joints which have constraints in rotation and have a constant distance between one another (with normal keyframed interpolation this is not guaranteed).

Get the DX8 SDK documentation for the best explanation on shaders, stencilbuffers etc.




David Hof
Destiny3D engine programmer
mail - icq - homepage
-------homepage - email
Simply put a stencil buffer is basically a ''thin'' bitmap (1 pixel thick) that is used to mask out various areas of the screen.

And if you are really smart you can use them to create shadows.



D.V.
D.V.Carpe Diem
quote:Original post by Countach
IK = Joints which have constraints in rotation and have a constant distance between one another (with normal keyframed interpolation this is not guaranteed).




That is incorrect. You can constrain joints in forward kinematics as well.

There are two types of animation using joints, forward kinematics and inverse kinematics. In forward kinematics you specify all the joint angles. (Rotate the shoulder 10 degrees, the elbow 5, the wrist 3, etc)

In inverse kinematics you specify the location of the end effector, and it figures out all the angles for you. So you tell the program where the hand should end up, and it figures out how much to bend the elbow for you. This has applications in robotics as well as computer animation.


Tahnks cheese grater, good stuff to know.
anyone know anything about anything else I asked?
And if you think I ask too many questions then why bother replying, i never asked for them all to be answered, just whatever anyone felt like answering.
thanks again

ByteMe95::~ByteMe95()
Cerebrum Software
ByteMe95::~ByteMe95()My S(h)ite
quote:Original post by ByteMe95

secondly, what is the best way/ how is character animation is done. From what I know u load a 3d model with pre-set key frames and interpolate through them (I''ve never done any of these things but would love to at some point).


Key frames are specific poses for your character to be in. You display smooth motion by automatically animating the intermediate poses moved through to move from one pose to the next.

This was a technique used by Disney and others in the bad old days of hand drawn animation. A head artist drew all the ''important'' poses, and lesser artists drew all the frames in between.

quote:
And does anyone know where there are good direct3d tutorials out there, I cant find any good ones, only on DX8 though!


Try nexe.gamedev.net

quote:
Let me throw a couple more questions in actually:
vertex/pixel shaders, what are they EXACTLY? I kind of know, but then when u speak of rpogrammable vertex/pixel shaders I have no idea what that is.


Basically, it lets you program other per-pixel or per-vertex operations then the ones in the default transformations and lighting, and still have them run in hardware. (with the right 3D card)

quote:
OOOOH, almost forgot, what the hell does the stencil buffer do and how does it work/what is it used for?


It works just like it sounds.
If you cut out a stencil from cardboard, then spray paint over it, you only end up painting the parts cut out of the stencil, right? That''s what it is. You only draw to the screen where the ''holes'' in the setencil buffer are. It''s one way to render shadows or reflections.

quote:
What is a mesh deformation/what is it used for?


You deform a mesh (3d Model). You use it when you want bendable characters or when you want to put a crater in the ground or something.

(whew! That was a lot of questions!)

Thanks anonymous poster, that''s all good to know

ByteMe95::~ByteMe95()
Cerebrum Software
ByteMe95::~ByteMe95()My S(h)ite
Inverse kinematics, is a mathematical method of handling systems of "bones". ie, if you have two sticks attached together and one end is fixed... and the sticks are of fixed length, then the orientation of the joint determines the position of the end of the stick. This defines a unique position and orientation of the setup... Inverse kinematics is a system, whereby you have hte same setup, but instead of ascribing the joint orientation, you specify the position of the end of the setup (the "hand"). Obviously in a single jointed system... then range of orientations is limited (the joint is limited to a circle in 3d space)... but consider a many jointed system... there are many ways in which the end of the body can reach the point required. Hence a good inverse kinematic algorithm, will find the position nearest to the current one, which meets the point, and will also find the "most comfortable." ie a slighty bent elbow is more comfortable than a completely straight one... have a look at:

http://freespace.virgin.net/hugo.elias/models/m_ik.htm

it is a great tutorial on hugo elias' site, that perfectly illustrates the system I am refering to...
In terms of games, inverse kinematics can be very useful, in making your animations more flexible... ie, when walking on rough terrain, you can make sure you characters feet meet the ground... or when pulling a level, your character will actually hold on to it, rather than playing out a preset animation... "Drakan" uses this system... if you play, and pull a lever, you will see that she reaches and pulls it, rather than aligning for a preset animation... there routine is not perfect, as the "comfort" of the position, as well as "self intersection" are not considered, hence the character sometimes reaches through her body, and pushes the level behind her.

As to character animation... storing the joint orientation as quaternions is a good plan, as if there is a large jump from one scene to the next, you get a nice (direct) transition. Euler angles will work in most cases however, as the distance from frame to frame is usually small, and a method like this will produce acceptable results.. ie linearly interpolate the euler angles for the joints between the frames, to produe smooth results (or do the same with quaternions) you can convert eule angle rotations to quaternion rotations, and if you do this when loading the skeletal models, and hte keyframes, it will have very little overhead.

No... what are vertex and pixel shaders...
Basically, a vertex shader, is a methematical routine, that using whatever information you wish, perturbs the verticies, or in theory alters any of their characterisitics, ie color, texture coords etc...
by programmable, you mean that you use a language to instruct the 3D card as to what form of transformation you require... ie you may wish to use a sin offset, depending on the vertical position of verticies... to produce a wobbly object.
A pixel shader is somewhat different... it is intended to alter the individual pixels that are drawn as part of an objects surface, depending on their location... eg, one could simply load texels from a 3D texture map, or generate shading, to implement bumpmapping, or use a raytracer to do reflection, or any other procedural texture (such as making wood grain within a tree you cut down. Again these are programmable, and hence can be customised to suite your needs.

Edited by - dmounty on September 27, 2001 7:27:50 AM
Wow, that site was so simple and SOOO informative, it was great. I can''t believe how simple he made inverse kinematic calculations work, damn.


ByteMe95::~ByteMe95()
Cerebrum Software
ByteMe95::~ByteMe95()My S(h)ite

This topic is closed to new replies.

Advertisement