Top Banner
Yingcai Xiao Game Development Interactive Animation
18
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Yingcai Xiao Game Development Interactive Animation.

Yingcai Xiao

Game DevelopmentInteractive Animation

Page 2: Yingcai Xiao Game Development Interactive Animation.

Video GameVideo Game

Interactive Animation: Interactive Animation:

user->user->interface (look) -> interface (look) ->

action (feel) -> action (feel) -> feedback (A/V, haptic)feedback (A/V, haptic)

Page 3: Yingcai Xiao Game Development Interactive Animation.

Video GameVideo Game

UserUser

ControllerController

DisplayDisplay

Game (Software)

Game (Software)

Page 4: Yingcai Xiao Game Development Interactive Animation.

Video GameVideo Game

Input Device Driver

Input Device Driver

DisplayDeviceDriver (GDI)

DisplayDeviceDriver (GDI)

Game (Software)

Game (Software)

Page 5: Yingcai Xiao Game Development Interactive Animation.

Game Programming ComponentsGame Programming Components

The Gang of Four (G4) for Interactive Animation

1. Controller (Input)2. Game Objects (Geometry and Attributes)3. Dynamics (Key Frame Animation)4. Event-driven Programming (EDP: connects

inputs to animation scripts)

The Gang of Four (G4) for Interactive Animation

1. Controller (Input)2. Game Objects (Geometry and Attributes)3. Dynamics (Key Frame Animation)4. Event-driven Programming (EDP: connects

inputs to animation scripts)

Page 6: Yingcai Xiao Game Development Interactive Animation.

Game controllers: input devicesGame controllers: input devices

The evolution of input devices:

CL (Commend Line Input)GUI (Graphical User Interface)NUI (Natural Interface)

The evolution of input devices:

CL (Commend Line Input)GUI (Graphical User Interface)NUI (Natural Interface)

Page 7: Yingcai Xiao Game Development Interactive Animation.

AnimationAnimation

Animation: any change that has a visual effect.

Motion Dynamics: movements (geometry change)

Update Dynamics: attribute change (color, texture, …)

Others: camera position, lighting, rendering techniques, …

Animation: any change that has a visual effect.

Motion Dynamics: movements (geometry change)

Update Dynamics: attribute change (color, texture, …)

Others: camera position, lighting, rendering techniques, …

Page 8: Yingcai Xiao Game Development Interactive Animation.

Key-frame AnimationKey-frame Animation

• Defining key-frames• Inbetweening with interpolations:

Lerping (linear interpolation)parabola interpolation

• Defining key-frames• Inbetweening with interpolations:

Lerping (linear interpolation)parabola interpolation

Page 9: Yingcai Xiao Game Development Interactive Animation.

Key-frame AnimationKey-frame Animation

Page 10: Yingcai Xiao Game Development Interactive Animation.

Neighborhoodskeletons: defineinterpolatedshapes

Page 11: Yingcai Xiao Game Development Interactive Animation.

Graphical languages P-curves (parametric representation of motion)

Page 12: Yingcai Xiao Game Development Interactive Animation.

Animation Control • Explicit: animator provides a description of everything

that occurs in the animation.• Tracking live action.• Procedural: movement computed by a procedure. • Actors (Object-oriented high-level procedural control)• Kinematics: positions and velocities of points.• Dynamics: physical laws that govern kinematics.• Physically based: cloth draping, plastics bending, …• Constraint-based: constraint movements.

• Explicit: animator provides a description of everything that occurs in the animation.

• Tracking live action.• Procedural: movement computed by a procedure. • Actors (Object-oriented high-level procedural control)• Kinematics: positions and velocities of points.• Dynamics: physical laws that govern kinematics.• Physically based: cloth draping, plastics bending, …• Constraint-based: constraint movements.

Page 13: Yingcai Xiao Game Development Interactive Animation.

Double BufferingWhy?

To reduce flickeringHow? Draw to the invisible back buffer

Copy to the visible front buffer. (Btblt)==>very fast with HW assistance

Why? To reduce flickering

How? Draw to the invisible back buffer

Copy to the visible front buffer. (Btblt)==>very fast with HW assistance

Page 14: Yingcai Xiao Game Development Interactive Animation.

Double Buffering – Pseudo Codevoid Draw(){ useCanvas(bbfr); DrawObjects(); useCanvas(SCREEN_CANVAS); copyPixel(bbfr, viewing-rectagle);}

void Draw(){ useCanvas(bbfr); DrawObjects(); useCanvas(SCREEN_CANVAS); copyPixel(bbfr, viewing-rectagle);}

Page 15: Yingcai Xiao Game Development Interactive Animation.

Separation of Development TasksSeparation of Development Tasks

The Gang of Four (G4) for Interactive Animation

1. Controller (Input)2. Game Objects (Geometry and Attributes)3. Dynamics (Key Frame Animation)4. Event-driven Programming (EDP: connects

inputs to animation scripts)

The Gang of Four (G4) for Interactive Animation

1. Controller (Input)2. Game Objects (Geometry and Attributes)3. Dynamics (Key Frame Animation)4. Event-driven Programming (EDP: connects

inputs to animation scripts)

Page 16: Yingcai Xiao Game Development Interactive Animation.

Two Aspects of Game DevelopmentTwo Aspects of Game Development

Look + Feel

Look: Appearance

•Game Objects (Geometry and Attributes)•can be created by artists •though a visual interface like Blender and Maya •or download prebuilt ones online (e.g. http://www.turbosquid.com/)

Look + Feel

Look: Appearance

•Game Objects (Geometry and Attributes)•can be created by artists •though a visual interface like Blender and Maya •or download prebuilt ones online (e.g. http://www.turbosquid.com/)

Page 17: Yingcai Xiao Game Development Interactive Animation.

Two Aspects of Game DevelopmentTwo Aspects of Game Development

Feel: Controlled Animation

•animation scripts•connected to input events via EDP •implemented by programmers•though a programming language •or a visual interface like Unity3D

Feel: Controlled Animation

•animation scripts•connected to input events via EDP •implemented by programmers•though a programming language •or a visual interface like Unity3D

Page 18: Yingcai Xiao Game Development Interactive Animation.

Graphics HW and SW LayersGraphics HW and SW Layers

Application Game Graphics SW

ApplicationInitialization

Utility

Game IDE

Application Library

OS GUI APIEvent Loop

Game Engine

OS EQ Interface Graphics Library Graphics Engine

Event Queue GDI GDI

OS OS

GPUGraphics HWGraphics Card