Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 376 Introduction to Computer Graphics 04 / 30 / 2007 Last Lecture :( Instructor: Michael Eckmann.

Similar presentations


Presentation on theme: "CS 376 Introduction to Computer Graphics 04 / 30 / 2007 Last Lecture :( Instructor: Michael Eckmann."— Presentation transcript:

1 CS 376 Introduction to Computer Graphics 04 / 30 / 2007 Last Lecture :( Instructor: Michael Eckmann

2 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Today’s Topics Questions? Radiosity discussion by Alex Danilevsky Then you'll fill out evaluation forms for the course Then I'll come back in the room and cover: –Surfaces (bicubic polynomial surfaces) –Speedups for polynomial evaluation –quick comment on Shape Grammars probably no time for Fractal geometry

3 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Recall that we defined parametric cubic curves as Q(t) = T M G. For surfaces we define a parametric cubic surface with two parameters, hence Q(s,t) for some particular value of s, say s 1, Q(s 1,t) is a parametric curve. Also, for some particular value of t, say t 1, Q(s,t 1 ) is a parametric curve. [ G 1 (t) ] Q(s,t) = S M G(t) = S M [ G 2 (t) ] [ G 3 (t) ] [ G 4 (t) ] where each G i (t) is a parametric cubic. So, each G i (t) = T M G i The overall G(t) geometry matrix contains 16 geometry items (whereas for cubic curves, G contained 4 geometry items.) Curve Surfaces

4

5 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Horner's rule for evaluating polynomials –consider the x-coordinate parametric cubic: x(t) = a x t 3 + b x t 2 + c x t + d x evaluated as is, operations used: –6 multiplies and 3 adds if you use Horner's rule, x(t) can be rewritten as: x(t) = [(a x t + b x )t + c x ]t + d x –3 multiplies and 3 adds –for all 3 coordinates, then you have 9 multiplies and 9 adds –we can do better Forward-difference calculations –generate successive values recursively by incrementing the previous value – x k+1 = x k + Δx k –Δx k is the forward difference Speedups for polynomial evaluation

6 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Forward-difference calculations –generate successive values recursively by incrementing the previous value x k+1 = x k + Δx k –Δx k is the forward difference –for parametric cubics if we divide our range of t into a set number of fixed intervals of size δ then x k = x(t k ) and x k+1 = x(t k+1 ) where t k+1 = t k + δ k=0,1,... x k = a x t k 3 + b x t k 2 + c x t k + d x x k+1 = a x t k+1 3 + b x t k+1 2 + c x t k+1 + d x = a x (t k +δ) 3 + b x (t k +δ) 2 + c x (t k +δ) + d x Δx k = x k+1 - x k = 3a x δt k 2 + (3a x δ 2 + 2b x δ)t k + (a x δ 3 + b x δ 2 + c x δ) Notice that Δx k is a quadratic polynomial in t Speedups for polynomial evaluation

7 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 we can do the same kind of thing but this is the second forward-difference Δx k = Δx k-1 + Δ 2 x k-1 –Δ 2 x k-1 is the second forward difference... Δ 2 x k-1 = 6a x δt k-1 + 6a x δ 3 + 2b x δ 2 Notice that Δ 2 x k-1 is a linear polynomial in t we can do the same kind of thing but this is the third forward-difference Δ 2 x k-1 = Δ 2 x k-2 + Δ 3 x k-2 –Δ 3 x k-2 is the third forward difference... Δ 3 x k-2 = 6a x δ 3 which is a constant in t Speedups for polynomial evaluation

8 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 x(t) = a x t 3 + b x t 2 + c x t + d x Δx k = 3a x δt k 2 + (3a x δ 2 + 2b x δ)t k + (a x δ 3 + b x δ 2 + c x δ) Δ 2 x k-1 = 6a x δt k-1 + 6a x δ 3 + 2b x δ 2 Δ 3 x k-2 = 6a x δ 3 We need initial values for x and the first and second forward differences when k = 0, t = 0 and we get the following x 0 = d x Δx 0 = a x δ 3 + b x δ 2 + c x δ Δ 2 x 0 = 6a x δ 3 + 2b x δ 2 and compute the first few x's and then to compute successive values of x it only takes 3 adds at each step: x k+1 = x k + Δx k Δx k = Δx k-1 + Δ 2 x k-1 Δ 2 x k-1 = Δ 2 x k-2 + Δ 3 x k-2 Speedups for polynomial evaluation

9 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 To see the forward differences algorithm, see the handout with the two algorithms (the first is brute force --- not even using Horner's rule). The brute force uses 11 multiplies and 10 additions. Horner's rule algorithm requires 9 multiplies and 10 additions. The forward differences algorithm only takes 9 additions (and 0 multiplies) to calculate the next point coordinates (after some initialization that takes some multiplies and adds.) Speedups for polynomial evaluation

10 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 See section 8-24 in our text. It's short. I suggest you read it and attend Tim Gildea's presentation of his thesis "LSystem Viewer: Interactive Visualization Software for Parametric DOL-Systems" which is at 8pm, TONIGHT, Monday April 30 th in Harder room 202. Two other students will present their work before Tim. 6:30 p.m. Kellen Affleck 7:15 p.m. Max Levine 8:00 p.m. Tim Gildea Shape Grammars

11 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Up until now, we have only discussed objects (Euclidean shapes) being described by equations. These methods are good for man-made objects that are smooth and have regular shapes. Natural objects like mountains, clouds, terrain, trees, etc. have surface shapes that aren't well described by equations. Instead these are better described by “procedures”. Fractal methods are a way to make a procedural description of a surface/object. Fractal objects have 2 important characteristics –infinite detail at every point –self-similarity between the parts to the overall features (see next slide) Fractal objects are specified by a procedure that does an operation repeatedly. Fractal Geometry

12

13 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Zooming in enough on an equation defined surface (Euclidean shape) will reveal the limit to the level of detail in the shape. Zooming in on a Fractal object will reveal the “limitless” detail in the shape. (I'll try to draw figure 8-67 in text pg 480.) Fractals are defined infinitely, but of course in graphics we will perform a finite number of steps and hence our objects will have finite dimensions. Fractal Geometry

14 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Self-similarity –entire object contains scaled down versions of itself as its subparts –each subpart is created by multiplying a scale factor by the whole object –each subpart can use the same scale factor or different ones –random variations can be employed -> statistically self-similar used for trees, leaves, etc. Fractal Geometry

15 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 Fractal Dimension D –a description of the amount of variation in the structure of a fractal object. a line is 1 dimensional, a square is 2 dimensional if we subdivide a line into N equal parts, each part is the original scaled down by a factor of N = N 1/1 = N 1/d if we subdivide a square into N equal parts, each part is the original scaled down by a factor of sqrt(N) = N 1/2 = N 1/d if we subdivide the Koch snowflake into 4 equal parts, each part is the original scaled down by a factor of 3, hence 3 = 4 1/d = 4 1/1.26186 The dimension of the Koch snowflake fractal = d = log(4)/log(3) which is approx. 1.2618595 See the slide showing the Koch snowflake Fractal Geometry

16 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 For deterministic, self-similar fractals we have Fractal initiator –start shape Fractal generator –the pattern that subparts of the initiator are replaced by The generation of the fractal is deterministic because we always replace a subpart of the initiator with the generator and we do this at each step exactly the same way every time. Example on the board (figure 8-70). Fractal Geometry

17

18

19 Michael Eckmann - Skidmore College - CS 376 - Spring 2007 For statistically, self-similar fractals we could have –a Fractal initiator and –randomly choose a generator from a set of generators to be the pattern to replace a subpart of the initiator at each step This is non-deterministic (won't get the same exact shape every time) due to the random choice of generator. Instead of random generators, –random scalings could be done or –something else that is random to make the fractal non-deterministic. see figure 8-80 for an example. Fractal Geometry


Download ppt "CS 376 Introduction to Computer Graphics 04 / 30 / 2007 Last Lecture :( Instructor: Michael Eckmann."

Similar presentations


Ads by Google