CACS305 Computer Graphics And Animation

Computer Graphics And AnimationUnit 98 min read

Animation Techniques: Keyframes, Motion, VR & Real-World Applications

Unit 9 of Computer Graphics And Animation covers keyframe animation, motion interpolation, VR systems, and animation pipelines, with real-world ties to Nepali apps (eSewa, Daraz) and global tech (YouTube, Google Maps). Learn step-by-step how animations are created, how VR works, and how to design sequences—complete wit

TAKEAWAYS:

  • Keyframe animation uses discrete frames to define motion; tweening fills gaps between them (e.g., Daraz’s product preview rotations).
  • VR systems rely on head-mounted displays (HMDs), motion tracking, and 3D rendering (e.g., Ncell’s AR ads or Google Earth’s street view).
  • Animation pipelines follow modeling → rigging → keyframing → rendering (e.g., YouTube’s animated ads or Kathmandu traffic simulations).
  • Motion laws (linear, angular, physics-based) dictate realistic movement (e.g., Pathao’s bike tilt animations).
  • Exam focus: Trace a keyframe sequence, compare VR vs. AR, and explain clipping in animation (e.g., hidden surface removal in Daraz’s 3D product views).

1. What Is Animation?

Animation is the art of creating the illusion of movement by displaying a sequence of static images (frames) in rapid succession. In computer graphics, this is achieved through:

  • Frame-by-frame animation: Drawing each frame individually (e.g., hand-drawn cartoons).
  • Keyframe animation: Defining critical poses and interpolating in-between (used in most 3D animations).
  • Procedural animation: Generating motion via algorithms (e.g., particle systems in fire/smoke).

REAL WORLD:

  • eSewa’s animated loading screens: Uses keyframe interpolation to show smooth transitions between icons (e.g., a spinning wheel → checkmark).
  • Daraz’s 3D product views: Applies hidden surface removal to let users rotate shoes without seeing clipping artifacts.
  • Pathao’s bike animations: Uses physics-based motion (angular velocity) to tilt bikes realistically when turning.

2. Keyframe Animation: The Backbone of Motion

Keyframe animation works by:

  1. Setting keyframes: Defining start/end poses (e.g., a character’s arm at 0° and 90°).
  2. Interpolating in-between: Calculating intermediate frames (e.g., 10 frames at 10° increments).
  3. Applying transformations: Rotating, scaling, or translating objects between keys.

How It Works: Linear vs. Non-Linear Interpolation

Type Formula Use Case Example
Linear Simple motion (e.g., sliding doors) Daraz’s product carousel
Bezier (Cubic) Smooth curves (e.g., character lips) YouTube’s animated emojis
Spline Piecewise polynomial curves Complex paths (e.g., robot arms) Industrial arm simulations (NTC)

WORKED EXAMPLE: Rotating a Daraz Product Suppose a shoe rotates 45° over 5 frames (linear interpolation):

  • Keyframe 1 (t=0): Angle = 0°
  • Keyframe 5 (t=1): Angle = 45°
  • Frame 3 (t=0.6): Angle =
012345Frame 1: 0°Frame 3: 27°Frame 5: 45°
Linear interpolation of a shoe rotating 45° over 5 frames (t=0 to t=1)

3. Motion Laws and Physics in Animation

Realistic animation follows physics principles:

  • Linear motion:
  • Angular motion: (e.g., a spinning fan).
  • Gravity: (e.g., a falling object).

REAL WORLD:

  • Pathao’s bike tilt: Uses angular velocity () to tilt bikes when turning.
  • Khalti’s transaction animations: Applies elastic motion (spring physics) for bouncy confirmation icons.
  • NEPSE stock charts: Uses spline interpolation for smooth candlestick curves.

WORKED EXAMPLE: Dropping a Ball (Gravity) Assume:

  • Initial height units,
  • Gravity units/s²,
  • Time seconds. Calculate height at and :

4. Virtual Reality (VR) and Animation

VR creates immersive 3D environments using:

  • Head-Mounted Displays (HMDs): Track head movement (e.g., Meta Quest, HTC Vive).
  • Motion Tracking: Sensors capture hand/body movements (e.g., Oculus Touch controllers).
  • Stereoscopic Rendering: Separate images for each eye to simulate depth.

Components of a VR System:

UsesFeeds data toRenders forHMDTrackingSystemGPUApplication
Core components of a VR system and their interactions

REAL WORLD:

  • Ncell’s AR ads: Uses VR-like tracking to overlay virtual products in real-world views (via phone cameras).
  • Google Earth VR: Renders 3D terrain with physics-based animations (e.g., clouds moving realistically).
  • Medical training (e.g., Kathmandu hospitals): VR simulates surgeries with haptic feedback (force feedback).

WORKED EXAMPLE: VR Head Movement If a user turns their head 30° left, the VR system:

  1. Detects rotation via gyroscope/accelerometer.
  2. Adjusts the field of view (FOV) by recalculating the camera’s view frustum.
  3. Renders new frames with hidden surface removal to avoid clipping.

5. Animation Pipelines: From Idea to Screen

A typical animation workflow:

REAL WORLD:

  • YouTube’s animated ads: Follows this pipeline (e.g., a dancing character → rigged → keyframed → rendered).
  • Daraz’s 3D product demos: Skips physics simulation but uses real-time ray tracing for reflections.
  • Khalti’s transaction animations: Uses pre-rendered sprites (simplified pipeline).

WORKED EXAMPLE: Animating a Kathmandu Traffic Light

  1. Model: A cube with red/green/yellow faces.
  2. Rig: Assign a "timer" bone to cycle colors.
  3. Keyframes:
    • Frame 1: Red = 100%, Green = 0%
    • Frame 10: Red = 0%, Green = 100%
  4. Render: Output as a looped video for traffic simulations.

6. Special Topics: Shadow and Motion Blur

  • Shadows: Use ray casting or shadow maps (e.g., Daraz’s product shadows).
  • Motion blur: Simulates camera shutter speed (e.g., a fast-moving Pathao bike).
123456-1-0.50.511.522.5xyObject Motion (sinusoidal)Motion Blur Effect (offset)
How motion blur represents velocity in animation (y-axis: blur intensity)

REAL PICTURE:


7. Exam Tip: How to Score Full Marks

  1. For keyframe questions:
    • Always show start/end frames and interpolation steps.
    • Use linear vs. Bezier comparisons (e.g., "Linear is faster but less smooth").
  2. For VR questions:
    • List 3 components (HMD, tracking, GPU) + one application (e.g., "Ncell’s AR ads").
  3. For animation pipelines:
    • Draw a flowchart (like above) and label 2-3 steps.
  4. Avoid:
    • Describing animation without math/formulas (e.g., "it moves smoothly" → show ).
    • Forgetting real-world ties (e.g., "eSewa uses keyframe interpolation for...").

8. Practice Questions (Exam Style)

  1. Short Notes:
    • Explain tweening with a 3-frame example.
    • Compare VR vs. AR (components + uses).
  2. Long Answer:
    • Design a 5-frame keyframe sequence for a Daraz product rotating 90° (show angles).
    • Describe how physics-based animation would make a Pathao bike tilt realistically.
  3. Trace:
    • Given a VR head turn of 45°, sketch the new view frustum and explain clipping.

KEY FORMULAS TO MEMORIZE:

  • Linear interpolation:
  • Angular motion:
  • Gravity:

Based on the TU BCA syllabus for Computer Graphics And Animation (CACS305), unit 9.

Discussion

Loading…