Presentation is loading. Please wait.

Presentation is loading. Please wait.

3-Dimensional Object Representation

Similar presentations


Presentation on theme: "3-Dimensional Object Representation"— Presentation transcript:

1 3-Dimensional Object Representation

2 Introduction Graphic scenes may contain many different kinds of objects: trees, clouds, houses, rocks, steel, sand, water, etc. Polygon & quadric surfaces provide precise descriptions for Simple Euclidean objects (polyhedrons & ellipsoid) Spline surface & constructive solid-geometric techniques – aircraft wings, gears, engineering structures with curved surfaces Procedural methods – cloud, grass, other natural object Physically based modeling methods octree encoding To produce realistic displays of scenes, we need to use representations that accurately modeled object characteristics

3 Introduction Representation schemes for solid objects are often divided into 2 categories Boundary representation (B-reps) Describe a 3D object as a set of surfaces that separate the object interior from the environment E.g.: polygon facets & spline patches Space partitioning representation Describes interior properties by partitioning the spatial region containing an object into a set of small, non-overlapping, contiguous solids (cubes) E.g.: octree

4 dodecahedron 1. Polyhedra Any solid figure with an outer surface composed of polygon faces Most commonly used boundary representation for a 3D graphics object A set of surface polygons that enclose the object interior All object descriptions are stored as a set of surface polygons To simplify and speed up surface rendering & object display (all surfaces are described with linear equations) Tetrahedron (or pyramid/4), hexahedron (or cube/6), octahedron (8), dodecahedron(12), icosahedron(20) To describe an object as a set of polygon faces: List of vertex coordinates Edge information Surface normal vectors

5 Polygon surfaces Polygon Tables
Specify a polygon surface with a set of vertex coordinates and associated attribute parameters As information for each polygon is input, the data are placed into tables that are to be used in the subsequent processing, display and manipulation of the objects in a scene Polygon data tables can be organized into 2 categories: Geometric tables Attribute tables

6 Polygon surfaces Geometric tables
Contains vertex coordinates and parameters to identify the spatial orientation of the polygon surface Geometric data are arranged in 3 lists Vertex table – coordinate values for each vertex Edge table – pointers back into the vertex table to identify vertices for each polygon edge Surface-facet table – pointers back into the edge table to identify edges for each polygon Attribute tables Include parameters specifying the degree of transparency of the object and its surface reflectivity & texture characteristics

7 Polygon surfaces VERTEX TABLE V1: x1,y1,z1 V2: x2,y2,y2 V3: x3,y3,z3
EDGE TABLE E1: V1,V2 E2: V2,V3 E3: V3,V1 E4: V3,V4 E5: V4,V5 E6: V5,V1 SURFACE-FACET TABLE S1 : E1,E2,E3 S2 : E3,E4,E5,E6

8 Polygon surfaces Alternative arrangement is to use just 2 tables: a vertex table and a polygon table  less convenient and some edges could get drawn twice Another method is to use only a surface-facets table  duplicates coordinate information (since explicit coordinate values are listed for each vertex in each polygon) Edge information would have to be reconstructed from the vertex listing in the polygon table

9 Polygon surfaces EDGE TABLE E1: V1,V2, S1 E2: V2,V3, S1
E3: V3,V1, S1,S2 E4: V3,V4, S2 E5: V4,V5, S2 E6: V5,V1, S2 Extra information can be added for faster information extraction Edge table for the surfaces of (A) expended to include pointers to the polygon table. So, common edges between polygons could be identified more rapidly Useful for rendering procedures that must vary surface shading smoothly across the edges from one polygon to the next Additional geometric information that is usually stored in the data tables includes the slope for each edge and the coordinate extents for each polygon edges, polygon facets and each object in a scene As vertices are input, edge slope can be calculated and the coordinate values can be scanned to identify the maximum & minimum x, y and z values for individual lines and polygons

10 Plane Equations To produce a display of 3D object, process the input data representation for the object through several procedures Processing steps include: Transformation of the modeling and world coordinate descriptions to viewing coordinates, then to device coordinates Identification of visible surfaces Application of surface rendering procedures Equation: Ax + By + Cz + D = 0 where (x,y,z): any point on the plane coefficients A, B, C, D: constant describing the spatial properties of the plane

11 Plane Equations Using Cramer’s rule A = 1 y1 z1 B = x1 1 z1
1 y2 z x z2 1 y3 z x z3 C = x1 y1 1 D = - x1 y1 z1 x2 y x2 y2 z2 x3 y x3 y3 z3 We can also write the calculation as: A = y1(z2 – z3) + y2(z3 – z1) + y3(z1 – z2) B = z1(x2 – x3) + z2(x3 – x1) + z3(x1 – x2) C = x1(y2 – y1) + x2(y3 – y1) + x3(y1 – y2) D = -x1(y2z3 – y3z2) – x2(y3z1 – y1z3) – x3(y1z2 – y2z1)

12 Plane Equations Orientation of a plane surface can be described with the normal vector to the plane as shown below. The surface normal vector has Cartesian components (A,B,C) where parameters A, B, and C are the plane coefficient Since we’re usually dealing with polygon surface that enclose an object interior, we need to distinguish between the 2 sides of the surface The side of the plane that faces the object interior is called the “inside” face and the visible / outward side is the “outside” face To determine the components of the normal vector for the shaded surface below, we need to select 3 of the 4 vertices along the boundary of the polygon. These points are selected in a counter clockwise direction as we view from outside the cube towards the origin

13 Plane Equations Coordinates for these vertices can be used in equation (4) to obtain the plane coefficients: A=1, B=0, C=0, D= -1. Thus, the normal vector for this plane is in the direction of the +ve x-axis Plane equations are used also to identify the position of spatial points relative to the plane surface of an object. For any point (x,y,z) not on a plane with parameters A, B, C, D, we have: Ax + By + Cz + D ≠ 0 The shaded polygon surfaces Of the unit cube has plane equation x – 1 = 0 and normal vector, N = (1,0,0)

14 Plane Equations To identify the point as either outside or inside the plane surface: if Ax + By + Cz + D < 0  point (x,y,z) is inside the surface if Ax + By + Cz + D > 0  point (x,y,z) is outside the surface Any point outside the shaded plane satisfies the inequality x – 1 > 0, while any point inside the plane has an x-coordinate value less than 1 (x<1) An inequality tests are valid in a right-handed Cartesian system, calculated using vertices selected in a counter-clockwise order when viewing the surface in an outside-to-inside direction

15 2. Quadric Surfaces Include spheres, ellipsoids, tori, paraboloids, hyperboloids (described with a second degree equation – quadratic) Quadric surfaces, particularly spheres and ellipsoids are common elements of graphics scenes Often available in graphics packages as primitives from which more complex objects can be reconstructed

16 Quadric Surfaces : Spheres
In Cartesian coordinates, a spherical surface with radius, r, centered on the coordinate origin is defined as the set of points (x,y,z) that satisfies the equation x2 + y2 + z2 = r2 The spherical surface is described in parametric form using latitude and longitude angles x = r cos Φ cos θ, - π/2 ≤ Φ ≤ π/2 y = r cos Φ sin θ, - π ≤ θ ≤ π z = r sin Φ These parametric representation provides a symmetric range for the angular parameters θ and Φ Φ θ Parametric coordinate position (r, θ , Φ) on the surface of a sphere with radius, r

17 Quadric Surfaces: Spheres
Alternatively, the parametric could be written using standard spherical coordinates, where angle Φ is specified as the co latitude Then, Φ is defined over the range 0 ≤ Φ ≤ π, and θ is often taken in the range 0 ≤ θ ≤ 2π The representation could also set up by using parameters u & v defined over the range from 0 to 1 by substituting Φ=πu and θ=2πv Φ θ Spherical coordinate parameters (r, θ , Φ) using colatitude for angle Φ

18 Quadric Surfaces: Ellipsoid
An ellipsoid surface can be described as an extension of a spherical surface, where the radius in 3 mutually perpendicular directions can have different values The Cartesian representation for points over the surface of an ellipsoid centered on the origin is (x/rx)2 + (y/ry)2 + (z/rz)2 = 1 A parametric representation for the ellipsoid is terms of the latitude angle Φ and the longitude angle θ in figure (a) x = rx cos Φ cos θ, - π/2 ≤ Φ ≤ π/2 y = ry cos Φ sin θ, π ≤ θ ≤ π z = rz sin Φ

19 Quadric Surfaces: Ellipsoid
ry rz rx An ellipsoid with radii, rx, ry and rz, centered on the coordinate origin

20 Quadric Surfaces: Torus
Is a doughnut shaped object Can be generated by rotating a circle or other conic about a specified axis The Cartesian representation for points over the surface of a torus can be written in the form: (r – ((x/rx)2 + (y/ry)2)1/2)2 + (z/rz)2 = 1 Where r is any given offset value. Parametric representation for a torus are similar to those for an ellipse, except that angle Φ extends over 360°

21 Quadric Surfaces: Torus
Using latitude and longitude angles Φ and θ, the torus surface can be described as the set of points that satisfy: x = rx (r + cos Φ) cos θ, - π ≤ Φ ≤ π y = ry (r + cos Φ) sin θ, π ≤ θ ≤ π z = rz sin Φ Φ θ A torus, centered on the coordinate origin, with a circular cross section and with the torus axis along the z-axis

22 3. Spline Representations
Spline is a flexible strip used to produce a smooth curve through a designated set of points Several small weights are distributed along the length of the strip to hold it in position on the drafting table as the curve is drawn The term spline curve originally referred to a curve drawn in this manner In computer graphics, the term spline curve refers to any composite curve formed with polynomial sections satisfying specified continuity condition at the boundary of the pieces

23 3. Spline Representations
A spline curve can be described with 2 sets of orthogonal spline curve There are several different kinds of spline specifications that are used in graphics applications To design curve and surface shapes To digitize drawings for computer storage To specify animation path for the objects or the camera in a scene E.g.: CAD  designing automobile bodies, aircraft, spacecraft surfaces and the ship hulls

24 Spline Representation: Interpolation & Approximation Spline
To specify a spline curve is by giving a set of coordinate positions, called control points, which indicates the general shape of the curve This control points are then fitted with piecewise continuous parametric polynomial functions in one of two ways When polynomial sections are fitted so that the curve passes through each control point  the curve is said to interpolate the set of control points A set of 6 control points interpolated with piecewise continuous polynomial section

25 Spline Representation: Interpolation & Approximation Spline
When the polynomials are fitted to the general control-point path without necessarily passing through any control point  curve is said to approximate the set of control points A set of 6 control points approximated with piecewise continuous polynomial sections

26 Spline Representation: Interpolation & Approximation Splines
Interpolation curves are commonly used to digitize drawings or to specify animation paths Approximation curves are primarily used as design tools to structure object surface A spline curve is defined, modified and manipulated with operations on the control points. By interactively selecting spatial positions for the control points, a designer can set up an initial curve After the polynomial fit is displayed for a given set of control points, the designer can then reposition some or all the of the control points to restructure the shape of the curve

27 Spline Representation: Interpolation & Approximation Splines
The curve can then be translated, rotated or scaled with transformation applied to the control points The convex polygon boundary that enclose a set of control points is called the convex hull Imagine a rubber band stretched around the positions of the control points so that each control point is either on the perimeter of the hull or inside it Convex-hull shape (dashed lines) for 2 sets of control points

28 Spline Representation: Interpolation & Approximation Splines
A polyline connecting the sequence of control points for an approximation spline is usually displayed to remind a designer of the control-point ordering This set of connected line segment is often referred to as the control graph of the curve Other names : control polygon and characteristic polygon Control-graph shapes (dashed lines) for 2 different sets of control points The shape of the control graph for the control-point sequence in previous figure

29 Parametric Continuity Conditions
To ensure a smooth transition from one section of a piecewise parametric curve to the next Impose various continuity conditions at the connection points. If each section of a spline is described with a set of parametric coordinate function of the form: x = x(u), y = y(u), z = z(u), u1 <= u <= u2 We set parametric continuity by matching the parametric derivatives of adjoining curve section at their common boundary

30 Parametric Continuity Conditions
Zero-order parametric continuity (C0 continuity) means simply that the curves meet. The values of x, y and z evaluated at u2 for the first curve section are equal, respectively, to the values of x, y and z evaluated at u1, for the next curve section

31 Parametric Continuity Conditions
First-order parametric continuity (C1 continuity) referred to as the 1st parametric derivatives (tangent line) of the coordinate functions for 2 successive curve sections are equal at their joining point The rate of change of tangent vectors for the 2 sections can be quite different (general shape of the 2 adjacent sections can change abruptly) Used in digitized drawings & some design application

32 Parametric Continuity Conditions
Second order parametric continuity (C2 continuity) means that both the 1st and 2nd parametric derivatives of the 2 curve sections are the same at the intersection The rates of change of the tangent vectors of connecting sections are equal at their intersection Tangent line transitions smoothly from 1 section of the curve to the next Useful in setting up animation path for camera motion & for CAD requirement

33 Cubic Spline Interpolation Methods
The most often used to set up paths for object motions to provide a representation for an existing object or drawing, but interpolation splines are also used sometimes to design object shapes Cubic polynomials offer a reasonable compromises between flexibility and speed of computation Cubic splines require less calculations and memory; more stable compared to higher order polynomials It’s more flexible for modeling arbitrary curve shapes compared to lower-order polynomials

34 Cubic Spline Interpolation Methods
Given a set of control points, cubic interpolation splines are obtained by fitting the input points with a piecewise cubic polynomial curve that passes through every control point We can describe the parametric cubic polynomial that is to be fitted between each pair of control points with the following set of equations: x(u) = axu3 + bxu2 + cxu + dx y(u) = ayu3 + byu2 + cyu + dy (0<= u <=1) z(u) = azu3 + bzu2 + czu + dz Need to determine a, b, c & d coefficients for each of the n curve section between the n+1 control points  set boundary condition A piecewise continuous cubic-spline interpolation of n+1 control points

35 Kochanek-Bartel Splines
Hermite Cardinal Kochanek-Bartel Splines Interpolating piecewise cubic polynomial with a specified tangent at each control point Interpolating piecewise cubic with specified endpoint tangents at the boundary of each curve section extension of the cardinal splines Can be adjusted locally because each curve section is only dependent on its endpoint constraints No need to give the values for the endpoint tangents 2 additional parameters are introduced to provide for further flexibility in adjusting the shape of curve sections digitizing applications (may not be too difficult to specify or approximate the curve slope) The value for the slope at a control point is calculated from the coordinates of the 2 adjacent control points Useful in model animation paths

36 Cubic Spline Interpolation Methods
Hermite Interpolation Named after a French Mathematician Charles Hermite Interpolating piecewise cubic polynomial with a specified tangent at each control point Can be adjusted locally because each curve section is only dependent on its endpoint constraints Useful for some digitizing applications where it may not be too difficult to specify or approximate the curve slope

37 Cubic Spline Interpolation Methods
Cardinal Splines Interpolating piecewise cubic with specified endpoint tangents at the boundary of each curve section No need to give the values for the endpoint tangents The value for the slope at a control point is calculated from the coordinates of the 2 adjacent control points

38 Cubic Spline Interpolation Methods
Kochanek-Bartel Splines An extension of the cardinal splines 2 additional parameters are introduced into the constraint equations defining Kochanek-Bartels splines to provide for further flexibility in adjusting the shape of curve sections Usually used to model animation paths

39 Bézier Curve & Surfaces
This spline approximation method was developed by the French engineer Pierre Bézier for use in the design of Renault automobile bodies It has a number of properties that make them highly useful and convenient for curve and surface design Easy to implement Widely available in various CAD systems, in general graphics packages, and in assorted drawing and painting packages (adobe Illustrator)

40 Bézier Curve Bézier curve sections can be fitted to any number of control points This number of control points to be approximated and their relative position determine the degree of the Bezier polynomial Commonly found in painting and drawing packages, as well as in CAD system 4th order Bézier curve quadratic Bézier curve cubic Bézier curve

41 Sweep Representation Useful for constructing 3D objects that possess translation, rotational or other symmetries Such objects can be represented by specifying a 2D shape and a sweep that moves the shape through a region of a space A set of 2D primitives, such as circles and rectangles can be provided for sweep representations as menu options Constructing a solid with a translation sweep. Translating the control points of the periodic spline curve in (a) generated the solid shown in (b), where surface can be described with point function P(u,v)

42 Sweep Representation The periodic spline curve in (a) defines the object cross section Perform a translational sweep by moving the control points P0 through P3 a set distance along a straight-line path perpendicular to the plane of the curve section At intervals along this path, replicate the cross-sectional shape and draw a set of connecting lines in the direction of the sweep to obtain the wire frame representation shown on (b)

43 Sweep Representation The figure is the example of object design using a rotational sweep The periodic spline cross section is rotated about an axis of rotation specified in the plane of the cross section to produce the wireframe representation as shown in (b) Any axis can be chosen for a rotational sweep. Is we use a rotation axis perpendicular to the plane of the spline cross section on (a), we generate a 2D shape Constructing a solid with a rotational sweep. Rotating the control points of the Periodic spline in (a) about the given rotation axis generates the solid shown in (b), Whose surface can be described with point function P(u,v)

44 End of chapter 6


Download ppt "3-Dimensional Object Representation"

Similar presentations


Ads by Google