comp 102 computer graphics and...

72
COMP 102 Computer Graphics and Animation Paul Kry 4 November, 2013

Upload: others

Post on 25-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

COMP 102Computer Graphics

and Animation

Paul Kry

4 November, 2013

Page 2: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

“There is no reason anyone would want a computer in their home.”Ken Olson, founder and president of DEC, 1977

“640K ought to be enough for anybody.”Bill Gates, cofounder of Microsoft, 1981

Page 3: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

“Computers are useless. They can only give you answers”

Pablo Picasso

Page 4: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Meats Meier

Art

Kenneth A. Huff

Page 5: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Games

Page 6: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Movies

Page 7: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Visualization

NASA[Li et al., 2007]

Page 8: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

CM Labs, crane simulator

Training

Boeing 747 flight simulator

Microsoft flight simulator

Page 9: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

What is Computer Graphics?

• A vast field that encompasses pretty much anything related to computer generated images– Modeling, rendering, animation,

image processing, visualization, interactive techniques, etc.

[example assignments and projects from 557 and 559]

Page 10: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Computer Graphics

Mathematics made visible

Page 11: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Evolution of computing environments

• Graphics has been a key to technology growth – Graphical user interfaces– Desktop publishing – Visualization– Gaming consoles

• Hardware revolution drives everything– price/performance

improving exponentially (Moore’s Law)

– Graphics processors oneven faster exponentials

[van Dam]

Page 12: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Date

Price

CPU

Memory

Storage

Monitor

Devices

GUI

1984 2012

$2500 $2000

8 MHz 3.1 GHz (Quad)

128KB RAM 4.0GB DDR2 SDRAM

(1 GB on GPU)

400KB Floppy 1TB Hard Disk

9” Black&White 27” Color512 x 342

68 dpi2560 x 1440

108 dpi

MouseKeyboard

MouseKeyboard

Desktop WIMP Desktop WIMP

+28

x .8

x 387(x 1550)

x 31250

x 2500000

x 3

x 21

x 1.6

samesame

same

Original Macintosh New iMac 27”

[van Dam]

Page 13: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Graphics Processing Unit (GPU)Not part of the previous comparison

GPUs now part of every machine,

arguably more powerful than CPUs

and programmable

2012

4,000,000,00010-Core Xeon

GTX680

Page 14: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Outline

• Geometry representation

• Rendering techniques

• Animation introduction

Page 15: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Representing Geometry

• Parametric / Explicit

– Points

– Line segments (2 points)p(t) = a t + b (1-t) t=[0,1]

– Triangles (3 points)

– Quadrilaterals (4 points)

– Parametric surfaces(x,y,z) = f(u,v)

• Implicit

– Geometry defined by the 3D points that satisfy

F(x,y,z) = 0

– Example: a planeF(x,y,z) = ax + by + cz + d

– Example: a sphereF(x,y,z) = x2 + y2 + z2 - 1

b

a

What is the best representation?

Page 16: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does geometry come from?

Page 17: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does geometry come from?

Artists

CAD models

[ES3DStudios][Mudbox]

Page 18: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does geometry come from?

Measurement• Multi camera stereo

• Laser scans

• Medical scans

[Beeler et al 2010]

Page 19: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does geometry come from?Procedural• Noise

• Fractals

• L-systems

• Scripts

Page 20: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does geometry come from?

Physically Based Modeling• Shapes produced through physics simulation

[Thürey et al. 2010] [Bridson et al. 2002]

Page 21: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for
Page 22: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Drawing Geometry

• Object Order Rendering

– Uses points, lines, and triangles(other geometry is converted to these primitives)

– Points defining primitives are projected onto the viewing plane, and rasterized (filled in)

• Image Order Rendering

– Called ray tracing (or ray casting) as a ray is generated for each pixel in the image

– Find intersections between rays and scene geometry

Page 23: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Object Order Rendering• Points, lines, and triangles

– All are defined by points

[Durand]

Page 24: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Object Order Rendering

Points are projected onto the image plane (left)

Triangle is rasterized (right)

[Durand]

Page 25: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Rasterization / Scan Conversion

• Drawing a line– For horizontal, vertical and

diagonal lines all pixels lie on ideal line

– For lines at arbitrary angle, pick pixels closest to ideal line

– Aliasing “Jaggies” fixed by adjusting intensity

Page 26: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Visibility • Painter’s algorithm

– Sort back to front

– Draw!

– Doesn’t always work...

[Durand]

Page 27: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Visibility • Binary space partition

– Linear time back to front sort

– Key to 3D games before consumer level GPUs (Doom 1993)

– Still important in modern games for culling geometry

[Durand]

Page 28: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Visibility • Z-buffer

– Store depth at every pixel

– Compare when rasterizing

Page 29: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Texture Mapping

Page 30: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Lighting / Shading

• How much light reflected to the eye?

• Depends on angles, materials

• What if light is occluded?

Page 31: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Object Order Rendering Summary

• FAST! Used for most interactive applications

• Also used for most movie production (e.g., Renderman used for Pixar films)

• Consumer graphics cards can render millions of triangles per frame

• Tricky to render realistic light transport (soft shadows, glossy reflections)

Page 32: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Image Order Rendering

• Follow light path in reverse, back toward the light

– Ray tracing finds the intersection of scene geometry with a ray starting at the eye and going through each pixel of the image plane.

Page 33: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Ray Tracing

• Cast rays from viewpoint through each pixel

• Lots of rays to cast... Expensive!

[Durand]

Page 34: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Ray Tracing

• Deal with shadows by casting more rays

– Cast rays from visible point towards lights

[Durand]

Page 35: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Reflection and Refraction

Relatively easy, just cast more rays

NV

IDIA

Op

tix

Page 36: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motion Blur

Relatively easy, just cast more rays

Co

ok e

t a

l. 1

98

4 (

Lu

ca

sfilm

)

Page 37: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Depth of Field

Relatively easy, just cast more rays

Lu

is A

lma

za

n(V

-Ra

y)

Page 38: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Lighting / Shading

• The full problem is actually much more complex!!!

– Light is everywhere and can even be scattered beneath the surface of materials

– Global illumination (holy grail of rendering)

[spin99, GELATO]

Page 39: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Ray Tracing Global Illumination• Even more rays to cast!

Super Expensive!

• Possible through careful sampling (e.g., Monte Carlo methods) and path tracing (working both from lights and viewer)[Durand]

Page 40: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

“If you were plowing a field, which would you rather use: Two strong oxen or 1024 chickens?”

Seymour Cray

Page 41: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for
Page 42: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

• NVIDIA GTX680 (2012)

• 3.5 billion transistors

• 1536 unified shaders

• IBM Cell processor

• PS3 (2005)

• 1 PPE + 8 SPE

Page 43: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Real time ray tracing

• 2007 - IBM

300000 triangles, 60 fps, 1080p, 14 Cell processors (PS3)http://www.youtube.com/watch?v=zKqZKXwop5E

• Today – NVIDIA

OPTIX / CUDA

2496 processors in TESLA K20

Design Garage Demo (2010)http://www.youtube.com/watch?v=kcP1NzB49zU

Page 44: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Image Order Rendering Summary

• Typically slower but easily parallelizable

• Smart data structures necessary to speed up ray scene intersections

• Easy to generate a variety of light transport effects, such as reflections on smooth surfaces

• Sampling provides a straightforward approach to many rendering issues

– depth of field, motion blur, area lights, BRDFs, antialiasing, etc.

Page 45: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

2D Images of 3D scenes

• The goal of rendering is typically to create images that provide information about a 3D world, much in the same way a camera can be used to take a picture

– Why does this work?

– What influences our perception of depth?

Page 46: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

reflection

stereopsisdefocus

fog / atmospheric

shading

texture gradient

occlusion

vergenceaccommodation

shadows

perspective size familiarityheight in image

Page 47: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Computer Animation

Page 48: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does motion come from?

• Artist based

– Key frames

• Physically based

– Simulation / Control

• Phenomenological

– Procedural animation

• Reality based

– Motion capture

Page 49: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Artists / Animators

Key frames

Page 50: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Artists / Animators

Inverse kinematics [Nakamura]

Blend Shapes

Page 51: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Physically based simulation

Page 52: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Physically based simulation

[Fedkiw et al.]

Page 53: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Procedural Animation

• Flocking behaviour and crowds

Boids [Reynolds 1987] Aggregate Dynamics [Narain et al. 2009]

Page 54: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Procedural Animation

Curl noise for procedural fluid flow, Bridson

Page 55: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motion Capture

• Directly captures subtleties of human motion

Page 56: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motion Capture

Andy SerkisGollum

Page 57: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motion Capture

Brian Carpenter

Page 58: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motion Capture

[Softimage Facerobot]

Page 59: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motion Capture

[Park, Hodgins, 2006]

Page 60: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Where does motion come from?

• Artist based– Key frames, blend shapes, inverse kinematics,

other tools

• Physically based– Simulation of equations of motion,

– Simulation of motor control

• Phenomenological– Procedural animation

• Reality based – Motion capture

Page 61: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Time Permitting

A quick introduction to physically based animation

Page 62: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Physically Based Computer Animation

• Differences from engineering and physics– Computer animation

• High visual detail

• High performance

• Low memory consumption

– Engineering and Numerical Physics

• Momentary visual details not needed

• Predict long term behaviour and or high precision

• High computation time and memory consumption

Page 63: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

It Came From Beneath The Sea (1955)“Fed up with traffic noise, Ray Harryhausen's giant six-tentacledoctopoid (cut back from eight to reduce stop-motion animation time),demolishes the Golden Gate Bridge.”

Page 64: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Motivation for physically based animation

• Physics in games?

– Add reality things move as you would expect

– Add variety different things happen

– Add fun

• Secondary animation

• Physics in training simulations?

• Physics in special effects?

• Why not? Hard?

Page 65: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Physically Based Animation

M x = f(x,x).. .

x(t)

Example forces:

gravity, f = m g

wind / drag, f = b x

springs, f = k x

user interaction, etc...

.

hard to compute exactly

x(0)

Page 66: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Discrete time steps

M x = f(x,x).. .

x(t) hard to compute exactly

x(0)

Page 67: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Discrete time steps

M x = f(x,x).. .

x0 = x(0)

x1 = x(h)

x2 = x(2h)

x(t) hard to compute exactly

Page 68: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Discrete time steps

M x = f(x,x).. .

x0

x1

x2

Page 69: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Numerical IntegrationForward Euler

x1 = x0 + h x0

..x = M-1 f(x,x).. . .

x0

x1

x2

.

Page 70: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Numerical IntegrationForward Euler

.x1 = x0 + h x0

x = M-1 f(x,x).. .

M-1 f(x0,x0).

x1 = x0 + h.

x0

x1

x2

.

Page 71: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Numerical IntegrationSymplectic Euler

.x1 = x0 + h x1

M-1 f(x0,x0).

x1 = x0 + h.

x0

x1

x2

.

Page 72: COMP 102 Computer Graphics and Animationcrypto.cs.mcgill.ca/~crepeau/COMP102/Comp1xx-GraphicsOverview … · COMP 102 Computer Graphics and Animation Paul Kry ... • Also used for

Numerical IntegrationBackwards Euler

.x1 = x0 + h x1

M-1 f(x1,x1).

x1 = x0 + h.

x0

x1

x2

.