Programming 3D animation?

What are the different animation processing methods for 3D games? Do you somehow program the animations in the modeler and, thus, the file, than you read and implement them in the game, or create animation functions to animate your stationary vectors?

Where are good tutorials for programming? Google just gave me the side of a fashion designer.

+6
animation 3d
source share
2 answers

In production environments, animators use specialized tools, such as Autodesk 3DS Max, to generate animations of 3D models with keyframes. For each animation for each model, the animator creates several poses for the model, called key frames, which are then exported to the game data format.

Then the game loads these key frames and animates the model at a specific time, it selects the two closest key frames and interpolates between them to ensure smooth animation even with a small number of key frames.

Animated models are usually built with a hierarchy of bones. There is a root bone that controls the location and orientation of the model in the game world. All other bones are defined relative to some parent bone to create a tree. Each vertex of the model is attached to a specific bone, so the model can be controlled with a much smaller number of parameters: the relative positions, orientations and scales of each bone.

Smooth skinning is a technique used to improve the quality of an animation. With a smooth skinning, the vertex is not attached to one bone, but it can be attached to several bones (usually a hard limit is set, such as 4, the vertices rarely need more than 3) with appropriate weights. This makes the animatorโ€™s job more difficult, as he should do a lot more work with vertices around the joints, but the result is a smoother animation with less distortion around the joints.

Alternatively, some games use procedural animation in which animation data is created at run time. The positions and orientations of the bones are calculated according to some algorithm, such as inverse kinematics or ragdoll physics . Of course, other options are available, but they must be encoded by programmers.

Instead of procedurally animating the bones and using forward kinematics to locate all the vertices of the model, another option is to simply process the position of each vertex yourself. This allows you to use more complex animations that are not connected by a hierarchy of bones, but, of course, it is much more complicated and much more difficult to do well.

+18
source share

Different ways to handle animation in games

For characters, usually:

  • Skeletal deformity
  • Overlay forms
  • Sometimes even fully animated grids (LA. Noire did it)
  • In the recent Tomb Raider, we use computational work to model thousands of hair splines, and the vertices are controlled by these splines with the vertex shader.

Often they are controlled by keyframe animations that are interpolated at runtime, and sometimes we add code to control influences (bones, blendshape weight, etc.) procedurally.

For some simple objects that move rigidly, sometimes the design will control the animation throughout the object without distorting it. Sometimes simple things, such as shrubs, can be moved using something similar to blendshapes, where you have a full mesh pose at several extreme points and you are a mixture between these extremes.

As for the textbooks ... well ... Are you interested in writing maths for animation on your own or are you more interested in getting some kind of animated character in your game and focusing on the gameplay?

For the whole gameplay, Unity is a great platform for the game.

If you are interested in learning math for animation or games in general, here is what I read as a primer:

  • Matrices used for 3d transformations (make sure you understand the commutative, associative and distributive laws and know what each row and column represents - they are easier than it seems)
  • Quaternions for rotation (less intuitive, but closely related to axis and rotation)

And don't leave the basics:

  • Vector Dot Product
  • Vector cross product

Also, like 10 years ago, I wrote a simple animation library, which is quite simple, free from most more advanced concepts, so it's nice to see if you want to get a basic idea of โ€‹โ€‹how this works: a href = "http: // animadead.sf.net "rel =" nofollow "> http://animadead.sf.net

Good luck

+3
source share

All Articles