D Graphics http://chamilo2.grenet.fr/inp/courses/ensimag4mmgd6/ Shape Modeling technique Shape representation! Part : Basic techniques. Projective rendering pipeline 2. Procedural Modeling techniques Shape Reconstruction of real objects Procedural Interactive. Local illumination & Textures 4. Computer animation: kinematics, physics, collisions Surface (B-Rep) Part 2 : Introduction to advanced methods 5. Interactive with parametric & implicit surfaces Volume 6. Animating complex objects: characters & natural scenes Shape : 2 viewpoints Modeling Techniques Shape Modeling techniques Reconstruction of real objects Procedural Interactive. Reconstruction - From real data - Not in this course! Surface (B-Rep) Volume either discrete or continuous examples: meshes parametric surfaces (splines, Bézier) voxels implicit surfaces. Procedural (in Part) 2. Interactive (in Part 2) Develop tools for computer artists Needs higher level
Procedural Geometric primitives created by a program Basic example: OpenGL programming Describe each object in the frame where it is the simplest Assemble them in a hierarchy for consistency! Example of hierarchical Character = hierarchy of limbs The foot remains connected to the leg when the hip articulates! A procedure creates the models Control through parameters, not geometry! Useful for large, repetitive scenes or objects Fractals Case of objects that are self similar at different scales Recursively add details Application to terrains Fractals Application to terrains Start with a pyramid. Recursively subdivide each face Add random vertical displacements at each iteration D = random (, /2) x height difference on the edge
Trajectories First natural scene in CG Grass: particles under gravity Wind particles interact with grass Trees: recursively throw particles Grammars Easiest method to generate plants : L-systems Simulate progressive growth using grammar rules [W. Reeves, SIGGRAPH 984] The adventures of Andre and Wally B. https://www.youtube.com/watch? v=9qhakeevl The most complex scene ever built at that time! Inspired from biology! Grammars Grammars Topology Rules for each kind of plant Embedding in D Statistics, light, damage General methodology. Define a set of shapes 2. Rules (take one shape and replace it with other shapes) Apply rules with a given probability Use random parameters in the created shapes. Derivation until only «terminal shapes» remain 4. Geometrical interpretation of the terminal shapes Many applications!
Shape grammar examples Exercise (TD) Progressive refinement Propose a procedural method to generate an ancient city Describe the main steps Schematically represent the main grammar rules Which other constraints should be accounted for? Puzzle grammar a b c d Insert b b Remove Replace a/d Solution: possible approaches Coarse to fine cities - Layout - D blocks - Refinement rules «Rama» 26, Eric Bruneton Procedural Procedural terrain, many different techniques Growing cities Combination 6
Conclusion on procedural Fast method to create large, structured scenes (millions of polygons) Can consistently account for constraints (self-similarities, growth rules, etc) BUT Need to define rules for each category of content Indirect control only, through the rule parameters In practice, interactive is mostly used Interactive & Computer animation Background : Spline curves How to define a curve? (part of surface, trajectory ) Easier to give a finite number N of control points The curve should be smooth in between u Exo: Should we use polynomial curves? Which degree? Spline curves Parametric form of curve segments Defined from control point Local control Joints between polynomial curve segments degree, C or C 2 continuity Control points give constraints on curve parameters 4 constraints on vectors suffice to fix 2 d.o.f. Control point Spline curve u
Interpolation vs. Approximation Hermite curves of order Degree, Order (C ). Each curve segment defined by: () = P i () = P i+ () = D i () = D i+ P i- P i+ P i D i D i+ Useful for animation Useful for smoother shapes Advantage: local control Exercise: how to ease the definition for general users? Propose an automatic way to compute tangents Cardinal Splines Hermite curves of order 2 Degree, Order (C ). Each curve segment defined by () = P i () = P i+ () = k(p i+ P i- ) () = k(p i+2 P i ) Catmull-Rom Cardinal with tension k =.5 Degree, Order 2 (C 2 ). - () = P i () = - () () = - () () = - () P i- P i+ P i Exercise Order of locality? What is the effect of k? How can we model a closed curve? Can be solved by adding tangent constraints at the extremities Problem: Global definition only! (costly & no local control)
Degree, C 2 Approximation Regularizing curve in particular: convex hull Curve point = barycenters of control points Segment defined by 4 points Curve segments uniquely defined! Uniform, cubic Bspline M Catmull Cubic splines: matrix equation Q i (u) = (u u 2 u ) M spline [P i- P i P i+ P i+2 ] t 2 2 Cardinal spline 5 2 4 M Bspline 6 B-spline 6 P 4 P 4 4 In summary: Splines curves Most important models Interpolation & approximation To be used Interpolation Hermite curves C, cannot be local if C 2 Cardinal spline (Catmull Rom) In computer animation For interpolating trajectories Part, Chapter Approximation Bézier curves Uniform, cubic B-spline Generalization to NURBS In interactive With extension to Spline surfaces Part 2, Chapter