Example B zier Surface Patch Define grid of 16 control points interpolates 4 corners Can draw patch by subdivision Drawing Splines with OpenGL OpenGL provides an evaluator mechanism for splines specify control points with glMap1f or glMap2f use glEvalCoord1f to evaluate the spline equation this gives us a grid of points on the surface just connect them together with quads or triangles Always uses B zier basis functions Bernstein polynomials but this is no problem can convert control points for other splines to B zier controls we just need to compute the right conversion matrices Building Objects with Patches Paste together multiple patches to cover entire object the Utah Teapot for example is built from 32 patches This raises some tricky questions how many patches needed how to guarantee continuity of patches while animating how can we cut holes in the surface trimming curves create boundary spline curves on surface Subdivision Surfaces Have become very successful primitive the subject of a lot of recent research naturally multiresolution representation continuum from polygon meshes to splines Like spline surfaces represent smooth surfaces well can be automatically built with scanners easier than polygons for manipulation DeRose Kass and Truong Pixar Animation Studios SIGGRAPH 98 Quadrilateral Subdivision of Polygons Split face in middle and connect to edge midpoints converts any polygon into set of quadrilaterals Smoothing by Barycentric Averaging Works just like it did with curves compute barycenters around vertex move vertex to barycenter of barycenters 1 1 4 4 1 1 4 4 1 v 1 v 1 v 1 v Extraordinary Points All the points we introduce by quad subdivision are valence 4 they all have 4 edges faces connected to them But there are other points with valence 4 these are called extraordinary points where most of the smoothness analysis action happens Demo http www subdivision org subdivision demos index jsp Looking for Realism with Procedural Models We want to be able to generate realistic looking objects our definition of realism is naturally somewhat fuzzy we know it when we see it reality has a complexity of shape which spheres splines lack for one thing most real objects are not perfectly smooth All our models so far have been essentially declarative the set of all points such that We can gain significant benefits from procedural models write programs to generate the models Today we ll look at fractal models typically recursive procedural methods Example The Sierpinski Gasket This is a deterministic fractal with obvious self similarity Generating by Recursive Subdivision sierpinski Vec2 a Vec2 b Vec2 c int depth if depth 0 Vec2 v0 a b 2 Vec2 v1 a c 2 Vec2 v2 b c 2 sierpinski a v0 v1 depth 1 sierpinski b v1 v2 depth 1 sierpinski c v2 v0 depth 1 else Output triangle a b c in black Adding Randomness to Fractals Deterministic fractals are certainly nice infinite self similar detail can be handy But we don t want all our objects to look the same suppose we want to synthesize terrain surfaces we want terrains that are distinct To address this problem we use randomness also referred to as noise or sometimes chaos Implementation note functions like rand are only pseudo random deterministic procedures whose results are statistically random designing such generators something of an arcane art Random Midpoint Displacement Recursive subdivision with random displacements start with some initial figure e g line or triangle split at midpoints add random displacement recurse decreasing the magnitude of displacements Example Fractal Terrain Level 2 Level 4 Level 6 Level 8 A More Complex Interesting Example image by F Kenton Musgrave Another Common Model L Systems These are grammar based fractal like models also sometimes called graftals we describe an object by a string of symbols and we provide a set of production rules incorporate notions such as branching pruning can also vary objects by randomly applying rules These are very common in modeling plant structures demo http www cpsc ucalgary ca Redirect bmv java LSystems LSys html
View Full Document
Unlocking...