cs g140 graduate computer graphics

39
June 27, 2022 1 College of Computer and Information Science, Northeastern University CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2007 Lecture 9 – March 26, 2007

Upload: taran

Post on 06-Jan-2016

21 views

Category:

Documents


0 download

DESCRIPTION

CS G140 Graduate Computer Graphics. Prof. Harriet Fell Spring 2007 Lecture 9 – March 26, 2007. Today’s Topics. Animation Fractals. Animation. Keyframing Set data at key points and interpolate. Procedural Let mathematics make it happen. Physics-based Solve differential equations - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS G140 Graduate Computer Graphics

April 20, 2023 1College of Computer and Information Science, Northeastern University

CS G140Graduate Computer Graphics

Prof. Harriet FellSpring 2007

Lecture 9 – March 26, 2007

Page 2: CS G140 Graduate Computer Graphics

April 20, 2023 2College of Computer and Information Science, Northeastern University

Today’s Topics

• Animation

• Fractals

Page 3: CS G140 Graduate Computer Graphics

April 20, 2023 3College of Computer and Information Science, Northeastern University

Animation

• Keyframing Set data at key points and interpolate.

• Procedural Let mathematics make it happen.

• Physics-based Solve differential equations

• Motion Capture Turn real-world motion into animation.

Page 4: CS G140 Graduate Computer Graphics

April 20, 2023 4College of Computer and Information Science, Northeastern University

Key Principles of AnimationJohn Lasseter 1987

• Squash and stretch• Timing• Anticipation• Follow through and overlapping action• Slow-in and slow-out• Staging• Arcs• Secondary action• Straight ahead and pose-to-pose action• Exaggeration• Solid drawing skill• Appeal

» Siggraph web reference

Page 5: CS G140 Graduate Computer Graphics

April 20, 2023 5College of Computer and Information Science, Northeastern University

PowerPoint Animation

Page 6: CS G140 Graduate Computer Graphics

April 20, 2023 6College of Computer and Information Science, Northeastern University

Animated gif

Johan Ovlinger’s Trip to Earth and Back

Page 7: CS G140 Graduate Computer Graphics

April 20, 2023 7College of Computer and Information Science, Northeastern University

Pyramid of 35 Spheres

Rendered by Blotwell using POV-Ray and converted with Adobe ImageReady.

Page 8: CS G140 Graduate Computer Graphics

April 20, 2023 8College of Computer and Information Science, Northeastern University

Deformation

Page 9: CS G140 Graduate Computer Graphics

April 20, 2023 9College of Computer and Information Science, Northeastern University

Blenderfree software, under the terms of the

GNU General Public License

Page 10: CS G140 Graduate Computer Graphics

April 20, 2023 10College of Computer and Information Science, Northeastern University

Character Animation

Page 11: CS G140 Graduate Computer Graphics

April 20, 2023 11College of Computer and Information Science, Northeastern University

Physics-Based Animation

http://www.cs.ubc.ca/labs/imager/imager-web/Research/images/michiel.gif

Page 12: CS G140 Graduate Computer Graphics

April 20, 2023 12College of Computer and Information Science, Northeastern University

Flash Animation

POWER OF THE GEEK

Page 13: CS G140 Graduate Computer Graphics

April 20, 2023 13College of Computer and Information Science, Northeastern University

Keyframing

• A frame is one of the many still images that make up a moving picture.

• A key frame is a frame that was drawn or otherwise constructed directly by the user.

• In hand-drawn animation, the senior artist would draw these frames; an apprentice would draw the "in between" frames.

• In computer animation, the animator creates only the first and last frames of a simple sequence; the computer fills in the gap.

• This is called in-betweening or tweening.

Page 14: CS G140 Graduate Computer Graphics

April 20, 2023 14College of Computer and Information Science, Northeastern University

Flash Basics

• Media objects graphic, text, sound, video objects

• The Timeline when specific media objects should appear on

the Stage

• ActionScript code programming code to make for user

interactions and to finely control object behavior

Page 15: CS G140 Graduate Computer Graphics

April 20, 2023 15College of Computer and Information Science, Northeastern University

Lord of the Rings Inside Effects

Page 16: CS G140 Graduate Computer Graphics

April 20, 2023 16College of Computer and Information Science, Northeastern University

Fractals

The term fractal was coined in 1975 by Benoît Mandelbrot, from the Latin fractus, meaning "broken" or "fractured".

(colloquial) a shape that is recursively constructed or self-similar, that is, a shape that appears similar at all scales of magnification.

(mathematics) a geometric object that has a Hausdorff dimension greater than its topological dimension.

Page 17: CS G140 Graduate Computer Graphics

April 20, 2023 17College of Computer and Information Science, Northeastern University

Mandelbrot Set

Mandelbrotset, rendered with Evercat's program.

Page 18: CS G140 Graduate Computer Graphics

April 20, 2023 18College of Computer and Information Science, Northeastern University

Mandelbrot Set

Page 19: CS G140 Graduate Computer Graphics

April 20, 2023 19College of Computer and Information Science, Northeastern University

What is the Mandelbrot Set?

2

:cf

z z c

+

£ £

a

( )0

where is the -fold composition of with itself.

nc

nc c

f

f n f

→ ∞/

We start with a quadratic function on the complex numbers.

The Mandelbrot Set is the set of complex c such that

Page 20: CS G140 Graduate Computer Graphics

April 20, 2023 20College of Computer and Information Science, Northeastern University

Example

( )( ) ( ) ( )

( )

( ) ( ) ( )( )( ) ( ) ( )( )

2

2

2

2 2

1

0 1 0 1 1 1 0

1 odd0

0 even

2 4 1 3 2 3 9 1 8

2 tend to as tends to .

1 2 2 4 1 3

tend to as tends to .

n

n

n

f z z

f f f

nf

n

f f f

f n

f i i f i f

f i n

= −

= − = − = − =

−⎧= ⎨⎩

= − = = = − =

∞ ∞

= − = − = − = − =

∞ ∞

Page 21: CS G140 Graduate Computer Graphics

April 20, 2023 21College of Computer and Information Science, Northeastern University

(Filled-in) Julia Sets

2

:cf

z z c

+

£ £

a

The Julia Set of fc is the set of points with 'chaotic' behavior under iteration.The filled-in Julia set (or Prisoner Set), is the set of all z whos orbits do not tend towards infinity. The "normal" Julia set is the boundary of the filled-in Julia set.

c = –1 c = –.5 +.5i c = – 5 +.5i

Page 22: CS G140 Graduate Computer Graphics

April 20, 2023 22College of Computer and Information Science, Northeastern University

Julia Sets and the Mandelbrot Set

Some Julia sets are connected others are not.

The Mandelbrot set is the set of c for which the Julia set of fc(z) = z2 + c is connected.

Map of 121 Julia sets in position over the Mandelbrot set (wikipedia)

Page 23: CS G140 Graduate Computer Graphics

April 20, 2023 23College of Computer and Information Science, Northeastern University

A fractal is formed when pulling apart two glue-covered acrylic sheets.

Page 24: CS G140 Graduate Computer Graphics

April 20, 2023 24College of Computer and Information Science, Northeastern University

Fractal Form of a Romanesco Broccoli

photo by Jon Sullivan

Page 25: CS G140 Graduate Computer Graphics

April 20, 2023 25College of Computer and Information Science, Northeastern University

Time for a Break

Page 26: CS G140 Graduate Computer Graphics

April 20, 2023 26College of Computer and Information Science, Northeastern University

L-Systems

• An L-system or Lindenmayer system, after Aristid Lindenmayer (1925–1989), is a formal grammar (a set of rules and symbols) most famously used to model the growth processes of plant development, though able to model the morphology of a variety of organisms.

• L-systems can also be used to generate self-similar fractals such as iterated function systems.

Page 27: CS G140 Graduate Computer Graphics

April 20, 2023 27College of Computer and Information Science, Northeastern University

L-System References

• Przemyslaw Prusinkiewicz & Aristid Lindenmayer, “The Algorithmic Beauty of Plants,” Springer, 1996.

• http://en.wikipedia.org/wiki/L-System

Page 28: CS G140 Graduate Computer Graphics

April 20, 2023 28College of Computer and Information Science, Northeastern University

L-System Grammar

• G = {V, S, ω, P}, where V (the alphabet) is a set of variables S is a set of constant symbols ω (start, axiom or initiator) is a string of symbols from

V defining the initial state of the system P is a set of rules or productions defining the way

variables can be replaced with combinations of constants and other variables.

• A production consists of two strings - the predecessor and the successor.

Page 29: CS G140 Graduate Computer Graphics

April 20, 2023 29College of Computer and Information Science, Northeastern University

L-System Examples

• Koch curve (from wikipedia)• A variant which uses only right-angles.

variables : F constants : + − start  : F rules  : (F → F+F−F−F+F)

• Here, F means "draw forward", + means "turn left 90°", and - means "turn right 90°" (see turtle graphics).

Page 30: CS G140 Graduate Computer Graphics

Turtle Graphicsclass Turtle { double angle; // direction of turtle motion in degrees double X; // current x position double Y; // current y position double step; // step size of turtle motion boolean pen; // true if the pen is down

public void forward(Graphics g) // moves turtle forward distance step in direction angle

public void turn(double ang)// sets angle = angle + ang;

public void penDown(), public void penUp()// set pen to true or false}

Page 31: CS G140 Graduate Computer Graphics

April 20, 2023 31College of Computer and Information Science, Northeastern University

My L-System Data Files

Koch Triangle Form // title4 // number of levels to iterate90 // angle to turnF // starting shapeF:F+F-F-F+F // a rule

F F+F-F-F+F F+F-F-F+F+F+F-F-F+F-F+F-F-F+F-F+F-F-F+F+F+F-F-F+F

Go to Eclipse

Page 32: CS G140 Graduate Computer Graphics

April 20, 2023 32College of Computer and Information Science, Northeastern University

More Variables

Dragon When drawing, treat L and R just like F.1090LL:L+R+R:-L-R

L L+R+ L+R+ + -L-R + L+R+ + -L-R + + - L+R+ - -L-R +

Page 33: CS G140 Graduate Computer Graphics

April 20, 2023 33College of Computer and Information Science, Northeastern University

A Different Angle

Sierpinski Gasket660RL:R+L+RR:L-R-L

R L-R-L R+L+R- L-R-L -R+L+R

Page 34: CS G140 Graduate Computer Graphics

April 20, 2023 34College of Computer and Information Science, Northeastern University

Moving with Pen Up

Islands and Lakes290F+F+F+FF:F+f-FF+F+FF+Ff+FF-f+FF-F-FF-Ff-FFFf:ffffff // f means move forward with the pen up

F+F+F+F

next slide

F+f-FF+F+FF+Ff+FF-f+FF-F-FF-Ff-FFF

Page 35: CS G140 Graduate Computer Graphics

April 20, 2023 35College of Computer and Information Science, Northeastern University

Islands and LakesOne Side of the Box

F+f-FF+F+FF+Ff+FF-f+FF-F-FF-Ff-FFF

Page 36: CS G140 Graduate Computer Graphics

April 20, 2023 36College of Computer and Information Science, Northeastern University

FF-[-F+F+F]+[+F-F-F]

Using a Stack to Make Trees

Tree1 [ push the turtle state onto the stack4 ] pop the turtle state from the stack22.5FF:FF-[-F+F+F]+[+F-F-F]

and I add leaves here

Page 37: CS G140 Graduate Computer Graphics

Stochastic L-Systemshttp://algorithmicbotany.org/lstudio/CPFGman.pdf

seed: 2454 // different seeds for different treesderivation length: 3axiom: FF--> F[+F]F[-F]F : 1/3F--> F[+F]F : 1/3F--> F[-F]F : 1/3

Page 38: CS G140 Graduate Computer Graphics

April 20, 2023 38College of Computer and Information Science, Northeastern University

3D Turtle Rotations

Heading, Left, or, Up vector tell turtle direction.+(θ) Turn left by angle θ◦ around the U axis.−(θ) Turn right by angle θ◦ around the U axis.&(θ) Pitch down by angle θ◦ around the L axis.∧(θ) Pitch up by angle θ◦ around the L axis.\(θ) Rollleftbyangleθ◦ around the H axis./(θ) Roll right by angle θ◦ around the H axis.| Turn around 180◦ around the U axis. @v Roll the turtle around the H axis so that H and U lie in a common vertical plane with U closest to up.

Page 39: CS G140 Graduate Computer Graphics

April 20, 2023 39College of Computer and Information Science, Northeastern University

A Mint http://algorithmicbotany.org/papers/

A model of a member of the mint family that exhibits a basipetalflowering sequence.