Download presentation
Published byQuentin Lindsey Modified over 9 years ago
1
Introduction to Computer Graphics PPT7: Object representations
EEL Introduction to Computer Graphics PPT7: Object representations Prepared by- Naveen Reddy Maddirala -U# Submitted to Dr. Les A. Piegl
2
Fall 2015 University Of South Florida-Tampa
Polygonal Modeling An object is formed from points called vertices (or vertexes) that define the shape and form polygons. Polygonal modeling is an approach for modeling objects by representing or approximating their surfaces using polygons. Polygonal modeling is well suited to scan line rendering and is therefore the method of choice for real-time computer graphics. A polygon is an area formed from at least three vertexes (a triangle). A four-point polygon is called a quad, and a polygon of more than four points is an n-gon. The vast majority of 3D-models today are built as textured polygonal models, because they are flexible and computers can render them so quickly.
3
Fall 2015 University Of South Florida-Tampa
Polygonal Modeling.,. For example, we have a cube (100x100x100 in size), on the left it has 1 segment in each dimension, in the middle three and on the right it has ten. As anyone can see, they all have exactly the same shape as cubes. But when I apply a mesh smooth with one iteration, the result is shown below each cube. This is what poly modeling is all about. The result is clear: the cube with 1x1x1 segments is extremely smoothed (it has almost become a sphere), the second cube is way less smoothed but then again, the cube with 10x10x10 segments is still very similar to it's original shape.
4
Quadric Surfaces 1-sheet hyperboloid 2-sheet hyperboloid ellipsoid
Fall University Of South Florida-Tampa Quadric Surfaces 1-sheet hyperboloid 2-sheet hyperboloid ellipsoid
5
Quadric Surfaces.,. hyperbolic parabaloid elliptic parabaloid
Fall University Of South Florida-Tampa Quadric Surfaces.,. hyperbolic parabaloid elliptic parabaloid hyperbolic cylinder parabolic cylinder
6
Fall 2015 University Of South Florida-Tampa
Quadric Surfaces.,. Fall University Of South Florida-Tampa A superellipse, also known as a Lamé curve after Gabriel Lamé, is a geometric figure defined in the Cartesian coordinate system as the set of all points (x, y) with OR where n, a and b are positive numbers.
7
Fall 2015 University Of South Florida-Tampa
Quadric Surfaces.,. The superellipsoid is a generalization of the ellipsoid. The version also called the superquadratic ellipsoid is defined by the equation Where, e and n are the east-west and north-south exponents, respectively. The generalization of the surface considered by Gray (1997) might also be called a superellipsoid.
8
Fall 2015 University Of South Florida-Tampa
Blobby Objects A blobby object mean a no rigid object. That is things, like cloth, rubber, liquids, water droplets, etc. These objects tend to exhibit a degree of fluidity. For example, in a chemical compound electron density clouds tend to be distorted by the presence of other atoms/molecules. Several models have been developed to handle these kind of objects. One technique is to use a combination of Gaussian density functions (Gaussian bumps). Another technique called the meta-ball technique is to describe the object as being made of density functions much like balls. The advantage here is that the density function falls of in a finite interval.
9
Fall 2015 University Of South Florida-Tampa
Blobby Objects.,. A Gaussian bump is a rank-1 function because it is separable, i.e., it can be written as a product of two univariate functions e^(-γ(x^2+y^2))=e^(-γx^2 ) e^(-γy^2 ) A surface function could then be defined by: f(x,y,z)=∑_k b_k*e^(-a_k*r_k^2 )-T=0 where r_k^ 2 = x_k^ 2 + y_k^ 2 + z_k^ 2
10
Fall 2015 University Of South Florida-Tampa
Blobby Objects.,. Metaballs, also known as blobby objects, are a type of implicit modeling technique. We can think of a metaball as a particle surrounded by a density field, where the density attributed to the particle (its influence) decreases with distance from the particle location. A surface is implied by taking an isosurface through this density field - the higher the isosurface value, the nearer it will be to the particle. The powerful aspect of metaballs is the way they can be combined. By simply summing the influences of each metaball on a given point, we can get very smooth blending’s of the spherical influence fields (see images below).
11
Bezier Representations
Fall University Of South Florida-Tampa Bezier Representations Definition
12
Bezier Representations.,.
Fall University Of South Florida-Tampa Bezier Representations.,. Bezier Properties
13
Bezier Representations.,.
Fall University Of South Florida-Tampa Bezier Representations.,. Examples We compute (x,y,z) by
14
B-spline Representations
Fall University Of South Florida-Tampa B-spline Representations B-splines automatically take care of continuity, with exactly one control vertex per curve segment Many types of B-splines: degree may be different (linear, quadratic, cubic,…) and they may be uniform or non-uniform With uniform B-splines, continuity is always one degree lower than the degree of each curve piece Linear B-splines have C0 continuity, cubic have C2, etc In the computer-aided design and computer graphics, spline functions are constructed as linear combinations of B-splines with a set of control points.
15
B-splines and Interpolation, Continuity
Fall University Of South Florida-Tampa B-splines and Interpolation, Continuity Uniform B-splines do not interpolate control points, unless: You repeat a control point three times But then all derivatives also vanish (=0) at that point To do interpolation with non-zero derivatives you must use non- uniform B-splines with repeated knots To align tangents, use double control vertices Then tangent aligns similar to Bezier curve Uniform B-splines are automatically C2 All the blending functions are C2, so sum of blending functions is C2 Provides an alternate way to define blending functions To reduce continuity, must use non-uniform B-splines with repeated knots
16
B-spline Representations
Fall University Of South Florida-Tampa B-spline Representations In computer-aided design, computer aided manufacturing, and computer graphics, a powerful extension of B-splines is non-uniform rational B-splines (NURBS). NURBS are essentially B-splines in homogeneous coordinates. NURBS are the most general, and are good when that generality is useful, or when conic sections must be accurately represented (CAD) Examples of graphics systems based on B-splines are UNISURF (Pierre Bezier) SKETCHPAD (Sutherland) AUTOKON (Mehlun) EUKLID (Engeli) CAGD Utah Conf.’74 (Barnhill & Riesenfeld)
17
Constructive Solid Geometry
Fall University Of South Florida-Tampa Constructive Solid Geometry Constructive solid geometry (CSG) (formerly called computational binary solid geometry) is a technique used in solid modeling. Constructive solid geometry allows a modeler to create a complex surface or object by using Boolean operators to combine objects. A method for constructing solid objects from Boolean combinations of solid primitives Operators: union, difference, intersection Primitives: spheres, cones, cylinders, cuboids, etc. Difference Intersection Union
18
Constructive Solid Geometry.,.
Fall University Of South Florida-Tampa Constructive Solid Geometry.,. Applications of CSG Nearly all engineering CAD packages use CSG. One of the advantages of CSG is that it can easily assure that objects are "solid" or water-tight if all of the primitive shapes are water-tight. This can be important for some manufacturing or engineering computation applications. By comparison, when creating geometry based upon boundary representations, additional topological data is required, or consistency checks must be performed to assure that the given boundary description specifies a valid solid object. A convenient property of CSG shapes is that it is easy to classify arbitrary points as being either inside or outside the shape created by CSG. The point is simply classified against all the underlying primitives and the resulting Boolean expression is evaluated. This is a desirable quality for some applications such as ray tracing.
19
Fall 2015 University Of South Florida-Tampa
Quadtrees Definition : A “quadtree” is a rooted tree so that every internal node has four children. Every node in the tree correspond to a square. If a node v has children, their corresponding squares are the four quadrants. Quadtrees can store many kind of data, we describe the variant that stores a set of points. Let P be a set of points. The definition of a quadtree for a set of points in a square Q = [x1Q : x2Q] £ [y1Q : y2Q] is as follows: If jPj · 1 then the quadtree is a single leaf where Q and P are stored. Otherwise let QNE, QNW, QSW and QSE denote the four quadrants. Let xmid := (x1Q + x2Q)=2 and ymid := (y1Q + y2Q)=2, and define PNE := fp 2 P : px > xmid and py > ymidg, PNW := fp 2 P : px · xmid and py > ymidg, PSW := fp 2 P : px · xmid and py · ymidg PSE := fp 2 P : px > xmid and py · ymidg. The quadtree consists of a root node v, Q is stored at v.
20
Fall 2015 University Of South Florida-Tampa
Quadtrees.,. Construction: The recursive definition implies a recursive construction algorithm. Only the starting square has to be chosen adequately. If the split operation cannot be performed well the quadtree is unbalanced. Despite this effect, the depth of the tree is related to the distance between the points. Theorem A quadtree of depth d which stores a set of n points has O((d + 1)n) nodes and can be constructed in O((d + 1)n) time. Hence it suffices to bound the number of internal nodes. Any internal node v has one or more points inside Q(v).The squares of the node of a single depth cover the initial square. So at every depth we have at most n internal nodes which gives the node bound. The most time-consuming task in one step of the recursive approach is the distribution of the points. The amount of time spent is only linear in the number of points and the O((d + 1)n) time bound holds. The 3D equivalent of Quadtrees are octrees. The quadtree construction can be easily extended to octrees in 3D. The internal nodes of octrees have eight sons and the sons correspond to boxes instead of squares
21
Fall 2015 University Of South Florida-Tampa
Quadtrees.,.
22
Fall 2015 University Of South Florida-Tampa
Octrees An octree is a tree data structure in which each internal node has exactly eight children. Octrees are most often used to partition a three dimensional space by recursively subdividing it into eight octants. Octrees are the three-dimensional analog of quadtrees. An octree takes the same approach as quadtrees, but divides a cube region of 3D space into octants Each region within an octree is referred to as a volume element or voxel Division is continued until homogeneous regions are discovered
23
Fall 2015 University Of South Florida-Tampa
Octrees.,. Examples .. Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)
24
Fall 2015 University Of South Florida-Tampa
Fractal Dimension The amount of variation in the structure of a fractal object is described as the fractal dimension, D More jagged looking objects have larger fractal dimensions Calculating the fractal dimension can be difficult, especially for particularly complex fractals. Fractals can be classified into three groups Self similar fractals These have parts that are scaled down versions of the entire object Commonly used to model trees, shrubs etc. Self affine fractals Have parts that are formed with different scaling parameters in each dimension Typically used for terrain, water and clouds Invariant fractal sets Fractals formed with non-linear transformations Mandelbrot set, Julia set – generally not so useful
25
Koch curves Fractals Discovered in 1904 by Helge von Koch
Fall University Of South Florida-Tampa Fractals Koch curves Discovered in 1904 by Helge von Koch Start with straight line of length 1 Recursively: Divide line into 3 equal parts Replace middle section with triangular bump with sides of length 1/3 New length = 4/3
26
Fall 2015 University Of South Florida-Tampa
Koch curves examples
27
Fractal generation with disjoint points
Fall University Of South Florida-Tampa Fractal generation with disjoint points A fractal object is generated by repeatedly applying a specified transform function to points in a region of space If P0 = (x0, y0, z0) is a selected initial position, each iteration of a transformation function F generates successive levels of detail with the calculations: In general the transformation is applied to a specified point set, or to a set of primitives (e.g. lines, curves, surfaces) Although fractal objects, by definition have infinite detail, we only apply the transformation a finite number of times Obviously objects we display have finite dimension – they fit on a page or a screen A procedural representation approaches a true representation as we increase the number of iterations The amount of detail is limited by the resolution of the display device, but we can always zoom in for further detail
28
Fern and leaf generation
Fall University Of South Florida-Tampa Fractals Fern and leaf generation Very similar techniques can be used to generate vegetation
29
Fractal via random midpoint displacement
Fall University Of South Florida-Tampa Fractal via random midpoint displacement One of the most successful uses of fractal techniques in graphics is the generation of landscapes One efficient method for doing this is random midpoint displacement. Easy to do in two dimensions Easily expanded to three dimensions to generate terrain Can introduce a roughness factor H to control terrain appearance Control surfaces can be used to start with a general terrain shape
30
Fall 2015 University Of South Florida-Tampa
Fractals Generating trees and other objects of nature Fractals are infinitely self-similar, iterated mathematical constructs having fractal dimension. For example, the leaves of ferns and umbellifers (Apiaceae) are only self-similar (pinnate) to 2, 3 or 4 levels. Fern-like growth patterns occur in plants and in animals including bryozoa, corals, hydrozoa like the air fern, Sertularia argentea, and in non-living things, notably electrical discharges. Lindenmayer system fractals can model different patterns of tree growth by varying a small number of parameters including branching angle, distance between nodes or branch points (internode length), and number of branches per branch point. Fractal-like patterns occur widely in nature, in phenomena as diverse as clouds, river networks, geologic fault lines, mountains, coastlines, animal coloration, snow flakes,crystals, blood vessel branching, and ocean waves. Fall University Of South Florida-Tampa
31
Fall 2015 University Of South Florida-Tampa
Generating trees and other objects of nature.,. Fall University Of South Florida-Tampa
32
Julia Set Fractals c = –1 c = –.5 +.5i c = – 5 +.5i
Fall University Of South Florida-Tampa Fractals Julia Set The Julia Set of fc is the set of points with 'chaotic' behavior under iteration. The filled-in Julia set (or Prisoner Set), is the set of all z who’s orbits do not tend towards infinity. The "normal" Julia set is the boundary of the filled-in Julia set. c = –1 c = –.5 +.5i c = – 5 +.5i
33
Mandelbrot set Fractals
Fall University Of South Florida-Tampa Fractals Mandelbrot set We start with a quadratic function on the complex numbers. The Mandelbrot Set is the set of complex c such that
34
Mandelbrotset, rendered with Evercat's program.
Fall University Of South Florida-Tampa Mandelbrotset, rendered with Evercat's program.
35
Fractals 3-D fractals via quaternions
Fall University Of South Florida-Tampa Fractals 3-D fractals via quaternions The Mandelbulb is a three-dimensional fractal, constructed by Daniel White and Paul Nylander using spherical coordinates in 2009 Hamilton defined a quaternion as the quotient of two directed lines in a three-dimensional space or equivalently as the quotient of two vectors. This thing is a three dimensional fractal calculated using Hamiltonian Quaternions. Made with the GPL licensed application named QUAT. Source: deviantart.com
36
Fall 2015 University Of South Florida-Tampa
Shape Grammars Procedural methods to generate natural and artificial shapes A shape grammar consists of shapes, labels, shape rules, and an initial shape. Shapes and their labels are the basis for the definition of shape rules. A shape rule has two parts - a left side shape(s) and a right side shape(s), separated by an arrow. A rule states that the shape(s) on the left side is transformed or replaced by the shape(s) on the right side. Given an initial shape, one transforms it using the rules of the grammar to produce a new shape or shapes. There are three procedural methods to generate natural and artificial shapes Texturing Modeling and Lighting
37
Procedural methods to generate natural and artificial shapes.,.
Fall University Of South Florida-Tampa Procedural methods to generate natural and artificial shapes.,.
38
Particle Systems Point based modeling
Fall University Of South Florida-Tampa Particle Systems Point based modeling Our point modeling basic process starts with an initialization step followed by three main loops (point generation, interactive cleanup, and user-driven refinement). These are executed to produce a set of 3D color points approximating the 3D objects displayed in the images. 1. Initialization: (a) Take photos (images) (b) Calibrate the images (c) Define a 3D zone of interest (envelope) (d) Draw a mask for each image (optional) 2. Generation Loop: (a) Generate a random 3D point within the zone of interest (b) Validation of 3D points: (i) Project the 3D point into each image; gather its associated colors from every visible image (ii) Keep the 3D point if the color distances are below a threshold in a (user controlled) sufficient number of images (c) Visibility: From time to time, recompute a depth map for each image from the set of 3D points
39
Particle Systems.,. 3. Interactive Cleanup: Cleanup by reevaluation
Fall University Of South Florida-Tampa Particle Systems.,. 3. Interactive Cleanup: Cleanup by reevaluation (a) Interactively increase the value of sufficient number, recompute depth maps (b) Discard the 3D points failing the new criteria (sufficient number and depth maps) Cleanup by rendering: For each view (i.e., original image): (a) Generate an image of the set of 3D points from this view (b) Compare the pixel colors in the original image with those in the generated image (c) Discard the 3D points resulting in incorrect image pixels A particle system is a collection of point masses that obeys some physical laws (e.g, gravity, heat convection, spring behaviors,..
40
Physically based Modeling Modeling based on energy minimization
Fall University Of South Florida-Tampa Physically based Modeling Modeling based on energy minimization Energy minimization Methods First-order minimization: Steepest descent, Conjugate gradient minimization Second derivative methods: Newton-Raphson method Quasi-Newton methods: L-BFGS
41
Fall 2015 University Of South Florida-Tampa
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.