Presentation is loading. Please wait.

Presentation is loading. Please wait.

In the name of God Computer Graphics. Shortcomings So Far The representations we have looked at so far have various failings: –Meshes are large, difficult.

Similar presentations


Presentation on theme: "In the name of God Computer Graphics. Shortcomings So Far The representations we have looked at so far have various failings: –Meshes are large, difficult."— Presentation transcript:

1 In the name of God Computer Graphics

2 Shortcomings So Far The representations we have looked at so far have various failings: –Meshes are large, difficult to edit, require normal approximations, … –Parametric instancing has a limited domain of shapes –CSG is difficult to render and limited in range of shapes –Implicit models are difficult to control and render –Production rules work in highly limited domains

3 Fractal A curve or geometrical figure each part of which has the same statistical character as the whole.

4 Fractal Surfaces Fractals are objects that show self similarity Fractal in nature like landscape & coastline –Mountains have hills on them that have rocks on them –Continents have gulfs that have harbors that have … The natural way of building fractal surfaces is subdivision –Start with coarse features, Subdivide to finer features –Different types of fractals come from different subdivision schemes and different parameters to those schemes

5 Fractals Infinite detail at every point Self similarity between parts and overall features of the object Model –Terrain, clouds water, trees, plants, feathers, fur, patterns General equation P1=F(P0), P2 = F(P1), P3=F(P2)… –P3=F(F(F(P0)))

6 Self similar fractals Parts are scaled down versions of the entire object –use same scaling on subparts –use different scaling factors for subparts Statistically self-similar –Apply random variation to subparts Trees, shrubs, other vegetation

7 Fractal types Statistically self-affine –random variations –terrain, water, clouds Invariant fractal sets –Nonlinear transformations Self squaring fractals –Julia-Fatou set »Squaring function in complex space –Mandelbrot set »Squaring function in complex space Self-inverse fractals –Inversion procedures

8 Julia-Fatou set Foley/vanDam Computer Graphics-Principles and Practices, 2 nd edition Julia-Fatou

9 Mandelbrot set Foley/vanDam Computer Graphics-Principles and Practices, 2 nd edition

10 Constructing a deterministic self- similar fractal Initiator –Given geometric shape Generator –Pattern which replaces subparts of initiator Koch Curve Initiator generator First iteration

11 Fractal dimension D=fractal dimension –Amount of variation in the structure –Measure of roughness or fragmentation of the object Small d-less jagged Large d-more jagged Self similar objects –ns d =1 (Some books write this as ns -d =1) s=scaling factor n number of subparts in subdivision d=ln(n)/ln(1/s) –[d=ln(n)/ln(s) however s is the number of segments versus how much the main segment was reduced »I.e. line divided into 3 segments. Instead of saying the line is 1/3, say instead there are 3 segments. Notice that 1/(1/3) = 3] –If there are different scaling factors S k d =1 K=1 n

12 Figuring out scaling factors Dimension is a ratio of the (new size)/(old size) –Divide line into n identical segments n=s –Divide lines on square into small squares by dividing each line into n identical segments n=s 2 small squares –Divide cube Get n=s 3 small cubes Koch’s snowflake –After division have 4 segments n=4 (new segments) s=3 (old segments) Fractal Dimension –D=ln4/ln3 = 1.262 –For your reference: Book method n=4 –Number of new segments s=1/3 –segments reduced by 1/3 d=ln4/ln(1/(1/3))

13 Sierpinski Fractal Divide each side by 2 –Makes 4 triangles –We keep 3 –Therefore n=3 Get 3 new triangles from 1 old triangle –s=2 (2 new segments from one old segment) Fractal dimension –D=ln(3)/ln(2) = 1.585

14 Cube Fractal Dimension Apply fractal algorithm –Divide each side by 3 –Now push out the middle face of each cube –Now push out the center of the cube What is the fractal dimension? –Well we have 20 cubes, where we used to have 1 n=20 –We have divided each side by 3 s=3 –Fractal dimension ln(20)/ln(3) = 2.727

15 Language Based Models of generating images Typical Alphabet {A,B,[,]} Rules –A=> AA –B=> A[B]AA[B] Starting Basis=B Generate words –Represents sequence of segments in graph structure –Branch with brackets –Interesting, tree based method

16 Language Based Models of generating images con’d Modify Alphabet {A,B,[,],(,)} Rules –A=> AA –B=> A[B]AA(B) –[] = left branch () = right branch Starting Basis=B Generate words –Represents sequence of segments in graph structure –Branch with brackets B A[B]AA(B) AA[A[B]AA(B)]AAAA(A[B]AA(B)) A AAAA B B A AAAA B AA B AAAAAAAA A B B

17 Language Based models have no inherent geometry Grammar based model requires –Grammar –Geometric interpretation Generating an object from the word is a separate process –examples Branches on the tree drawn at upward angles Choose to draw segments of tree as successively smaller lengths –The more it branches, the smaller the last branch is Draw flowers or leaves at terminal nodes A AAAA B AA B AAAAAAAA A B B

18 Grammar and Geometry Change branch size according to depth of graph Foley/vanDam Computer Graphics-Principles and Practices, 2 nd edition

19 Particle Systems System is defined by a collection of particles that evolve over time Def. subatomic constituent of physical world e.g. electron, photon, neutron –Particles have fluid-like properties(no fixed shape, gas like) Flowing, billowing, splashing, expanding, imploding(collapse), exploding –Basic particle can be any shape Sphere, box, ellipsoid, etc –Apply probabilistic rules to particles generate new particles Change attributes according to age –What color is particle when detected? –What shape is particle when detected? –Transparancy over time? Particles die (disappear from system) Movement –Deterministic or stochastic laws of motion( Kinematically, forces such as gravity)

20 Particle Systems modeling Model –Fire, fog, smoke, fireworks, trees, grass, waterfall, water spray. Grass –Model clumps by setting up trajectory paths for particles Waterfall –Particles fall from fixed elevation Splash to ground –Eg. drop, hit rock, finish in pool –Drop, go to bottom of pool, float back up.

21 Physically based modeling Non-rigid object –Rope, cloth, soft rubber ball Describe behavior in terms of external and internal forces –Approximate the object with network of point nodes connected by flexible connection Example springs with spring constant k –Homogeneous object Hooke’s Law –F s =-k x x=displacement, F s = restoring force on spring Could model with elastic material –Minimize strain energy k k k k

22 Fractal Terrain (1) Start with a coarse mesh –Vertices on this mesh won’t move, so they can be used to set mountain peaks and valleys –Also defines the boundary –Mesh must not have dangling edges or vertices Every edge and every vertex must be part of a face Also define an “up” direction Then repeatedly: –Add new vertices at the midpoint of each edge, and randomly push them up or down –Split each face into four

23 Fractal Terrain Example A mountainside

24 Fractal Terrain Details There are options for choosing where to move the new vertices –Uniform random offset –Normally distributed offset – small motions more likely –Procedural rule – eg Perlin noise Scaling the offset of new points according to the subdivision level is essential –For the subdivision to converge to a smooth surface, the offset must be reduced for each level Colors are frequently chosen based on “altitude”

25 Fractal Terrains http://members.aol.com/maksoy/vistfrac/sunset.htm

26 Terrain, clouds generated using procedural textures and Perlin noise http://www.planetside.co.uk/ -- tool is called Terragen

27 Terrain, clouds generated using procedural textures and Perlin noise http://www.planetside.co.uk/ -- tool is called Terragen

28 Subdivision Operations Split an edge, create a new vertex and two new edges –Each edge must be split exactly once –Need to know endpoints of edge to create new vertex Split a face, creating new edges and new faces based on the old edges and the old and new vertices –Require knowledge of which new edges to use –Require knowledge of new vertex locations

29 Fractal Terrain Algorithm The hard part is keeping track of all the indices and other data Same algorithm works for subdividing sphere Split_One_Level(struct Mesh terrain) Copy old vertices for all edges Create and store new vertex Create and store new edges for all faces Create new edges interior to face Create new faces Replace old vertices, edges and faces

30 Data Structure Issues We must represent a polygon mesh so that the subdivision operations are easy to perform Questions influencing the data structures: –What information about faces, edges and vertices must we have, and how do we get at it? –Should we store edges explicitly? –Should faces know about their edges?

31 Edge Data (iteration 1) The mesh must store all the edges, because we need to loop over them to split them The edge must store its endpoints, because we need them to split the edge A flag to turn off vertex perturbation is useful for boundary edges struct Edge { intv_start; // Index of start vertex intv_end; // Index of end vertex boolno_perturb; }

32 Face Data Faces are triangles To split, a face must know its vertices or edges. Which? To split, the face needs to know where the new vertices and new edges are stored –They were created when each edge was split –Where do we store them so that the face can find them?


Download ppt "In the name of God Computer Graphics. Shortcomings So Far The representations we have looked at so far have various failings: –Meshes are large, difficult."

Similar presentations


Ads by Google