Procedural Approaches Curves Week 12, Fri 21 Nov 2003

Slides:



Advertisements
Similar presentations
Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Advertisements

Lecture Notes #11 Curves and Surfaces II
Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
2002 by Jim X. Chen: Bezier Curve Bezier Curve.
Lecture 10 Curves and Surfaces I
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
© University of Wisconsin, CS559 Spring 2004
Jehee Lee Seoul National University
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Curves Chiew-Lan Tai. Curves 2 Reading Required Hearn & Baker, 8-8 – 8-10, 8-12 Foley, 11.2.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures III, Procedural.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Curves Week 12, Wed Apr.
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Modelling: Curves Week 11, Wed Mar 23
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Splines III – Bézier Curves
Curve Modeling Bézier Curves
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
V. Space Curves Types of curves Explicit Implicit Parametric.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Textures III Week 10,
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
CS 445/645 Fall 2001 Splines/Film/Animation. Final Exam Thursday, December 13 th from 7 – 10 p.m. –Room Olsson 011 You may use one sheet of notes (8.5.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Procedural Approaches.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Representation of Curves and Surfaces Graphics.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
Review CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
11/26/02(C) University of Wisconsin Last Time BSplines.
(c) 2002 University of Wisconsin
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Textures III, Procedural.
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 12: Curves 1
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
Introduction to Parametric Curve and Surface Modeling
CS5500 Computer Graphics May 11, 2006
Curve & Surface.
CS 445 / 645 Introduction to Computer Graphics
Parametric Curves cgvr.korea.ac.kr.
Procedural, Collision University of British Columbia
2D Spline Curves CS 465 Lecture 15 © 2004 Steve Marschner • 1.
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
Advanced Computer Graphics: Parametric Curves and Surfaces
Parametric Curves.
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Spline Curves COMP 575/COMP 770.
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
UNIT-5 Curves and Surfaces.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Last Time B-splines Project 3 was made available
Presentation transcript:

Procedural Approaches Curves Week 12, Fri 21 Nov 2003

News midterm solutions out late hw2: handin box 18, CICSR basement project 3 out final location announced LSK 200 noon Tue Dec 9 must have photo ID student ID best Week 12, Fri 21 Nov 03 © Tamara Munzner

Display Technologies recap mobile display with laser to retina stereo glasses/display 3D scanners laser stripe + camera laser time-of-flight cameras only, depth from stereo Shape Tape haptics (Phantom) 3D printers Week 12, Fri 21 Nov 03 © Tamara Munzner

Color LCD Answer three subpixels for each pixel color filter on each http://electronics.howstuffworks.com/lcd5.htm Week 12, Fri 21 Nov 03 © Tamara Munzner

Virtual Trackball recap Rotation about axis n = p1 x p2 Angle of rotation: p1 • p2 = |p1| |p2| cos θ Fixed point is origin if use [-1, 1] cube Week 12, Fri 21 Nov 03 © Tamara Munzner

Procedural Approaches

Procedural Modeling textures, geometry procedural approach explicitly stored in memory procedural approach compute something on the fly often less memory cost visual richness fractals, particle systems, noise Week 12, Fri 21 Nov 03 © Tamara Munzner

Fractal Landscapes fractals: not just for “showing math” triangle subdivision vertex displacement recursive until termination condition http://www.fractal-landscapes.co.uk/images.html Week 12, Fri 21 Nov 03 © Tamara Munzner

Self-Similarity infinite nesting of structure on all scales Week 12, Fri 21 Nov 03 © Tamara Munzner

Fractal Dimension D = log(N)/log(r) N = measure, r = subdivision scale Hausdorff dimension: noninteger Koch snowflake coastline of Britain D = log(N)/log(r) D = log(4)/log(3) = 1.26 http://www.vanderbilt.edu/AnS/psychology/cogsci/chaos/workshop/Fractals.html Week 12, Fri 21 Nov 03 © Tamara Munzner

Language-Based Generation L-Systems: after Lindenmayer Koch snowflake: F :- FLFRRFLF F: forward, R: right, L: left Mariano’s Bush: F=FF-[-F+F+F]+[+F-F-F] } angle 16 http://spanky.triumf.ca/www/fractint/lsys/plants.html Bush { ; Adrian Mariano Angle 16 Axiom ++++F F=FF-[-F+F+F]+[+F-F-F] }                                                                                                        Week 12, Fri 21 Nov 03 © Tamara Munzner

1D: Midpoint Displacement divide in half randomly displace scale variance by half http://www.gameprogrammer.com/fractal.html Week 12, Fri 21 Nov 03 © Tamara Munzner

2D: Diamond-Square diamond step square step generate a new value at square midpoint average corner values + random amount gives diamonds when have multiple squares in grid square step generate new value at diamond midpoint gives squares again in grid Week 12, Fri 21 Nov 03 © Tamara Munzner

Particle Systems loosely defined key criteria modeling, or rendering, or animation key criteria collection of particles random element controls attributes position, velocity (speed and direction), color, lifetime, age, shape, size, transparency predefined stochastic limits: bounds, variance, type of distribution Week 12, Fri 21 Nov 03 © Tamara Munzner

Particle System Examples objects changing fluidly over time fire, steam, smoke, water objects fluid in form grass, hair, dust physical processes waterfalls, fireworks, explosions group dynamics: behavioral birds/bats flock, fish school, human crowd, dinosaur/elephant stampede Week 12, Fri 21 Nov 03 © Tamara Munzner

Explosions Animation http://www.cs.wpi.edu/%7Ematt/courses/cs563/talks/psys.html Week 12, Fri 21 Nov 03 © Tamara Munzner

Boid Animation bird-like objects http://www.red3d.com/cwr/boids/ Week 12, Fri 21 Nov 03 © Tamara Munzner

Particle Life Cycle generation dynamics death randomly within “fuzzy” location initial attribute values: random or fixed dynamics attributes of each particle may vary over time color darker as particle cools off after explosion can also depend on other attributes position: previous particle position + velocity + time death age and lifetime for each particle (in frames) or if out of bounds, too dark to see, etc Week 12, Fri 21 Nov 03 © Tamara Munzner

Particle System Rendering expensive to render thousands of particles simplify: avoid hidden surface calculations each particle has small graphical primitive (blob) pixel color: sum of all particles mapping to it some effects easy temporal anti-aliasing (motion blur) normally expensive: supersampling over time position, velocity known for each particle just render as streak Week 12, Fri 21 Nov 03 © Tamara Munzner

Perlin Noise excellent tutorial explanation http://www.kenperlin.com/talk1 http://mrl.nyu.edu/~perlin/planet/ Week 12, Fri 21 Nov 03 © Tamara Munzner

Procedural Approaches Summary fractals L-systems particle systems Perlin noise not at all complete list! big subject: entire classes on this alone Week 12, Fri 21 Nov 03 © Tamara Munzner

Curves

Parametric Curves parametric form for a line: x, y and z are each given by an equation that involves: parameter t some user specified control points, x0 and x1 this is an example of a parametric curve Week 12, Fri 21 Nov 03 © Tamara Munzner

Splines a spline is a parametric curve defined by control points term “spline” dates from engineering drawing, where a spline was a piece of flexible wood used to draw smooth curves control points are adjusted by the user to control shape of curve Week 12, Fri 21 Nov 03 © Tamara Munzner

Splines – Old School Week 12, Fri 21 Nov 03 © Tamara Munzner

Splines - History Draftsman use ‘ducks’ and strips of wood (splines) to draw curves Wood splines have second-order continuity And pass through the control points A Duck (weight) Ducks trace out curve Week 12, Fri 21 Nov 03 © Tamara Munzner

Hermite Spline Hermite spline is curve for which user provides: endpoints of the curve parametric derivatives of the curve at the endpoints parametric derivatives are dx/dt, dy/dt, dz/dt more derivatives would be required for higher order curves Week 12, Fri 21 Nov 03 © Tamara Munzner

Hermite Cubic Splines example of knot and continuity constraints Week 12, Fri 21 Nov 03 © Tamara Munzner

Hermite Spline (2) say user provides cubic spline has degree 3, is of the form: for some constants a, b, c and d derived from the control points, but how? we have constraints: curve must pass through x0 when t=0 derivative must be x’0 when t=0 curve must pass through x1 when t=1 derivative must be x’1 when t=1 Week 12, Fri 21 Nov 03 © Tamara Munzner

Hermite Spline (3) solving for the unknowns gives rearranging gives or Week 12, Fri 21 Nov 03 © Tamara Munzner

Basis Functions a point on a Hermite curve is obtained by multiplying each control point by some function and summing functions are called basis functions Week 12, Fri 21 Nov 03 © Tamara Munzner

Sample Hermite Curves Week 12, Fri 21 Nov 03 © Tamara Munzner

Splines in 2D and 3D we have defined only 1D splines: x=f(t:x0,x1,x’0,x’1) for higher dimensions, define control points in higher dimensions (that is, as vectors) Week 12, Fri 21 Nov 03 © Tamara Munzner

Bezier Curves (1) different choices of basis functions give different curves choice of basis determines how control points influence curve in Hermite case, two control points define endpoints, and two more define parametric derivatives for Bezier curves, two control points define endpoints, and two control the tangents at the endpoints in a geometric way Week 12, Fri 21 Nov 03 © Tamara Munzner

Bezier Curves (2) user supplies d control points, pi write the curve as: functions Bid are the Bernstein polynomials of degree d this equation can be written as matrix equation also there is a matrix to take Hermite control points to Bezier control points Week 12, Fri 21 Nov 03 © Tamara Munzner

Bezier Basis Functions for d=3 Week 12, Fri 21 Nov 03 © Tamara Munzner

Some Bezier Curves Week 12, Fri 21 Nov 03 © Tamara Munzner

Bezier Curve Properties first and last control points are interpolated tangent to curve at first control point is along line joining first and second control points tangent at last control point is along line joining second last and last control points curve lies entirely within convex hull of its control points Bernstein polynomials (the basis functions) sum to 1 and are everywhere positive can be rendered in many ways convert to line segments with subdivision alg Week 12, Fri 21 Nov 03 © Tamara Munzner

Rendering Bezier Curves (1) evaluate curve at fixed set of parameter values and join points with straight lines advantage: very simple disadvantages: expensive to evaluate the curve at many points no easy way of knowing how fine to sample points, and maybe sampling rate must be different along curve no easy way to adapt: hard to measure deviation of line segment from exact curve Week 12, Fri 21 Nov 03 © Tamara Munzner

Rendering Bezier Curves (2) recall that Bezier curve lies entirely within convex hull of its control vertices if control vertices are nearly collinear, then convex hull is good approximation to curve also, a cubic Bezier curve can be broken into two shorter cubic Bezier curves that exactly cover original curve suggests a rendering algorithm: keep breaking curve into sub-curves stop when control points of each sub-curve are nearly collinear draw the control polygon - the polygon formed by control points Week 12, Fri 21 Nov 03 © Tamara Munzner

Sub-Dividing Bezier Curves step 1: find the midpoints of the lines joining the original control vertices. call them M01, M12, M23 step 2: find the midpoints of the lines joining M01, M12 and M12, M23. call them M012, M123 step 3: find the midpoint of the line joining M012, M123. call it M0123 Week 12, Fri 21 Nov 03 © Tamara Munzner

Sub-Dividing Bezier Curves curve with control points P0, M01, M012 and M0123 exactly follows the original curve from the point with t=0 to the point with t=0.5 curve with control points M0123 , M123 , M23 and P3 exactly follows the original curve from the point with t=0.5 to the point with t=1 Week 12, Fri 21 Nov 03 © Tamara Munzner

Sub-Dividing Bezier Curves M12 P1 P2 M012 M0123 M123 M01 M23 P0 P3 Week 12, Fri 21 Nov 03 © Tamara Munzner

Sub-Dividing Bezier Curves P1 P2 P0 P3 Week 12, Fri 21 Nov 03 © Tamara Munzner

de Casteljau’s Algorithm You can find the point on a Bezier curve for any parameter value t with a similar algorithm Say you want t=0.25, instead of taking midpoints take points 0.25 of the way M12 P2 P1 M23 t=0.25 M01 P0 P3 Week 12, Fri 21 Nov 03 © Tamara Munzner

Invariance translational invariance means that translating control points and then evaluating curve is same as evaluating and then translating curve rotational invariance means that rotating control points and then evaluating curve is same as evaluating and then rotating curve these properties are essential for parametric curves used in graphics easy to prove that Bezier curves, Hermite curves and everything else we will study are translation and rotation invariant some forms of curves, rational splines, are also perspective invariant can do perspective transform of control points and then evaluate curve Week 12, Fri 21 Nov 03 © Tamara Munzner