Top Banner
Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3
32

Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Dec 20, 2015

Download

Documents

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: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Intro to Simulation and Virtual Reality

CE00166-1

Animation v Simulation

Week 3

Page 2: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

What is simulation? Simulation is Designing, Implementing, Running, and Using

either Models or Software to represent systems Simulation is Used

To gain insights into the system To predict what a system will do For Education and Training When it is “better” than using the system

Some Examples Flight and Traffic simulators Simulation of Slow Processes or New Designs Simulations to drive Animations Monte Carlo Simulation

Page 3: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Monte Carlo simulation How did Monte Carlo simulation get its name? Monte Carlo

simulation was named for Monte Carlo, Monaco, where the primary attractions are casinos containing games of chance. Games of chance such as roulette wheels, dice, and slot machines, exhibit random behaviour.

The random behaviour in games of chance is similar to how Monte Carlo simulation selects variable values at random to simulate a model. When you roll a die, you know that either a 1, 2, 3, 4, 5, or 6 will come up, but you don't know which for any particular roll. It's the same with the variables that have a known range of values but an uncertain value for any particular time or event (e.g. interest rates, staffing needs, stock prices, inventory, phone calls per minute).

Page 4: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Technical Attractions of Technical Attractions of SimulationSimulation

Ability to compress time, expand time Ability to control sources of variation Avoids errors in measurement Ability to stop and review Ability to restore system state Facilitates replication Modeler can control level of detail

Page 5: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Ways To Study A SystemWays To Study A System

Page 6: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

IntroductionIntroduction

What is discrete-event simulation? Modeling, simulating, and analyzing systems Computational and mathematical techniques

Model: construct a conceptual framework that describes a system

Simulate: perform experiments using computer implementation of the model

Analyze: draw conclusions from output that assist in decision making process

Page 7: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Characterizing a ModelCharacterizing a Model

Deterministic or Stochastic Does the model contain stochastic components? Randomness is easy to add to a DES

Static or Dynamic Is time a significant variable?

Continuous or Discrete Does the system state evolve continuously or only at

discrete points in time? Continuous: classical mechanics Discrete: queuing, inventory, machine shop models

Page 8: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

DefinitionsDefinitions

Discrete-Event Simulation Model Stochastic: some state variables are random Dynamic: time evolution is important Discrete-Event: significant changes occur at

discrete time instances Monte Carlo Simulation Model

Stochastic Static: time evolution is not important

Page 9: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Model TaxonomyModel Taxonomy

Page 10: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

DES Model DevelopmentDES Model Development

Algorithm 1.1 — How to develop a model:1) Determine the goals and objectives2) Build a conceptual model3) Convert into a specification model4) Convert into a computational model5) Verify6) Validate

Typically an iterative process

Page 11: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Three Model LevelsThree Model Levels Conceptual

Very high level How comprehensive should the model be? What are the state variables, which are dynamic, and

which are important? Specification

On paper May involve equations, pseudocode, etc. How will the model receive input?

Computational A computer program General-purpose PL or simulation language?

Page 12: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Verification vs. ValidationVerification vs. Validation Verification

Computational model should be consistent with specification model

Did we build the model right?

Validation Computational model should be consistent with the

system being analyzed Did we build the right model? Can an expert distinguish simulation output from

system output?

Interactive graphics can prove valuable

Page 13: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

A Machine Shop ModelA Machine Shop Model

150 identical machines: Operate continuously, 8 hr/day, 250 days/yr Operate independently Repaired in the order of failure Income: £20/hr of operation

Service technician(s): 2-year contract at £52,000/yr Each works 230 8-hr days/yr

How many service technicians should be hired?

Page 14: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

System DiagramSystem Diagram

Page 15: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Algorithm AppliedAlgorithm Applied1) Goals and Objectives:

— Find number of technicians for max profit— Extremes: one techie, one techie per machine

2) Conceptual Model:— State of each machine (failed, operational)— State of each techie (busy, idle)— Provides a high-level description of the system at

any time

3) Specification Model:— What is known about time between failures?— What is the distribution of the repair times?— How will time evolution be simulated?

Page 16: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Algorithm AppliedAlgorithm Applied4) Computational Model:

— Simulation clock data structure— Queue of failed machines— Queue of available techies

5) Verify:— Software engineering activity— Usually done via extensive testing

6) Validate:— Is the computational model a good approximation of

the actual machine shop?— If operational, compare against the real thing— Otherwise, use consistency checks

Page 17: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Graphics = algorithms for visual simulation

Page 18: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

What would we have to model/simulate ? models of shape -- need to be deformable [skeleton, skin] lighting (shadows) physical motion light bending by lenses (refraction) surface texture controlling/specifying motion perspective depth of field camera model / camera control sound effects & music story

Page 19: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Physics Simulation Particles Rigid bodies

Collisions, contact, stacking, rolling, sliding

Articulated bodies Hinges, constraints

Deformable bodies (solid mechanics) Elasticity, plasticity, viscosity Fracture Cloth

Fluid dynamics Fluid flow (liquids & gasses) Combustion (fire, smoke,

explosions…) Phase changes (melting,

freezing, boiling…) Vehicle dynamics

Cars, boats, airplanes, helicopters, motorcycles…

Character dynamics Body motion, skin & muscle,

hair, clothing

Page 20: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Computer Animation

What is Animation? Make objects change over time

according to scripted actions

What is Simulation? Predict how objects change

over time according to physical laws or behavioral analysis

Page 21: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Principle of Traditional Animation – Disney –

Squash and Stretch Slow In and Out Anticipation Exaggeration Follow Through and Overlapping Action Timing Staging Straight Ahead Action and Pose-to-Pose Action Arcs Secondary Action Appeal

Page 22: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Squash and Stretch

Page 23: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Slow In and Out

Page 24: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Anticipation

Page 25: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Principle of Traditional Animation – Disney –

Squash and Stretch Slow In and Out Anticipation Exaggeration Follow Through and Overlapping Action Timing Staging Straight Ahead Action and Pose-to-Pose Action Arcs Secondary Action Appeal

Page 26: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Computer Animation

Animation Pipeline 3D modeling Motion specification Motion simulation Shading, lighting, & rendering Postprocessing

Page 27: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Keyframe Animation

Define Character Poses at Specific Time Steps Called “Keyframes”

Page 28: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Keyframe Animation

Interpolate Variables Describing Keyframes to Determine Poses for Character in between

Page 29: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Inbetweening

Linear Interpolation Usually not enough continuity

Page 30: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Inbetweening

Spline Interpolation Maybe good enough

Page 31: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Inbetweening

Cubic Spline Interpolation Maybe good enough

May not follow physical laws !!

Page 32: Intro to Simulation and Virtual Reality CE00166-1 Animation v Simulation Week 3.

Summary

Simulation is… Animation is… Graphics is a simulation Animation Requires ...

Modeling Scripting Inbetweening Lighting, shading Rendering Image processing