HT Games
Home  >> Video Games

Mathematical Formulas for Video Game Animation: Complete Reference

Game animation relies on a core mathematical toolkit. Key formulas by category:

1. Interpolation & Blending

  • LERP (Linear): P = A + t(B - A), t ∈ [0,1]
  • SLERP (Quaternion spherical): q = q₀ (q₀⁻¹q₁)ᵗ – constant angular velocity
  • NLERP (Normalized LERP): Faster approx for small angles
  • Squad / Cubic spline: Smooth multi-key interpolation

2. Rotations

  • Quaternions: q = (w, x, y, z), ||q||=1. Avoid gimbal lock. Composition: q₂q₁
  • Rotation matrix (3×3): Orthonormal, det=1. From quaternion: standard conversion
  • Euler angles: Intuitive but singularities; use only for UI/authoring

3. Curves & Motion Paths

  • Bézier (cubic): B(t) = (1-t)³P₀ + 3(1-t)²t P₁ + 3(1-t)t² P₂ + t³P₃
  • B-spline / NURBS: Local control, knot vectors
  • Catmull-Rom: Interpolating spline, C¹ continuous

4. Inverse Kinematics (IK)

  • CCD (Cyclic Coordinate Descent): Iterative joint rotation toward target
  • FABRIK (Forward/Backward Reaching): Position-based, fast, stable
  • Analytic (2-bone): Law of cosines → closed-form knee/elbow angle

5. Physics Integration

  • Semi-implicit Euler: v₊ = v + aΔt; x₊ = x + v₊Δt (stable for springs)
  • Verlet / Position-Based Dynamics: x₊ = 2x - x₋ + aΔt² (constraint-friendly)
  • Runge-Kutta 4 (RK4): High accuracy for non-stiff systems

6. Procedural / Secondary Motion

  • Spring-damper: F = -kx - cv (cloth, hair, tails)
  • Noise (Perlin/Simplex): Organic jitter, wind
  • Wave functions: sin(ωt + φ) for breathing, idle sway

7. Skinning

  • Linear Blend Skinning (LBS): v' = Σ wᵢ Mᵢ v
  • Dual Quaternion Skinning (DQS): Preserves volume, no candy-wrapper

Engines (Unreal, Unity, Godot, Frostbite) wrap these in animation graphs, state machines, and compute shaders.


https://www.htfbw.com © HT Games