Computer Graphics · Unit 5 · 7 hrs
3D Objects Representation
Exam-focused notes for 3D Objects Representation (Computer Graphics, CSC214): what the TU syllabus asks and how it has actually been tested, with 13 solved past questions from this unit.
3D Objects Representation in short
A 3D graphics system needs a way to store the shape of an object inside the computer before it can transform, project or shade it. This chapter surveys the main representation schemes, from flat polygon boundaries to smooth parametric curves and simple quadric solids.
What this unit covers
- Representing Surfaces: Boundary and Space partitioning
- Polygon Surface: Polygon tables, Surface normal and Spatial orientation of surfaces, Plane equations, Polygon meshes
- Wireframe Representation
- Blobby Objects
- Representing Curves: Parametric Cubic Curves, Spline Representation, Cubic spline interpolation, Hermite Curves, Bezier and B-spline Curve and surface
- Quadric Surface: Sphere and Ellipsoid
Representing Curves
2081 · 5 marks
Construct the Bezier curve with the following polygon vertices (control points): A(1,1), B(2,3), C(4,3), and D(6,4). [5]
Show solved answerHide answer
Bezier Curve Construction
Given
Control points (4 points → cubic Bezier, degree $n = 3$):
- $P_0 = A(1, 1)$
- $P_1 = B(2, 3)$
- $P_2 = C(4, 3)$
- $P_3 = D(6, 4)$
Solution
Bezier / Bernstein Blending Functions
$$P(u) = \sum_{k=0}^{3} P_k , BEZ_{k,3}(u), \quad 0 \le u \le 1$$
$$BEZ_{k,3}(u) = \binom{3}{k} u^k (1-u)^{3-k}$$
| $k$ | Blending Function |
|---|---|
| 0 | $(1-u)^3$ |
| 1 | $3u(1-u)^2$ |
| 2 | $3u^2(1-u)$ |
| 3 | $u^3$ |
Parametric Equations
$$x(u) = 1(1-u)^3 + 6u(1-u)^2 + 12u^2(1-u) + 6u^3$$ $$y(u) = 1(1-u)^3 + 9u(1-u)^2 + 9u^2(1-u) + 4u^3$$
Point Computations
u = 0: $x = 1,; y = 1$
u = 0.2: $(1-u)=0.8$ $$x = 0.512 + 6(0.2)(0.64) + 12(0.04)(0.8) + 6(0.008)$$ $$= 0.512 + 0.768 + 0.384 + 0.048 = 1.712$$ $$y = 0.512 + 9(0.2)(0.64) + 9(0.04)(0.8) + 4(0.008)$$ $$= 0.512 + 1.152 + 0.288 + 0.032 = 1.984$$
u = 0.4: $(1-u)=0.6$ $$x = 0.216 + 6(0.4)(0.36) + 12(0.16)(0.6) + 6(0.064)$$ $$= 0.216 + 0.864 + 1.152 + 0.384 = 2.616$$ $$y = 0.216 + 9(0.4)(0.36) + 9(0.16)(0.6) + 4(0.064)$$ $$= 0.216 + 1.296 + 0.864 + 0.256 = 2.632$$
u = 0.5: $(1-u)=0.5$ (midpoint, useful check) $$x = 0.125 + 6(0.5)(0.25) + 12(0.25)(0.5) + 6(0.125)$$ $$= 0.125 + 0.75 + 1.5 + 0.75 = 3.125$$ $$y = 0.125 + 9(0.5)(0.25) + 9(0.25)(0.5) + 4(0.125)$$ $$= 0.125 + 1.125 + 1.125 + 0.5 = 2.875$$
u = 0.6: $(1-u)=0.4$ $$x = 0.064 + 6(0.6)(0.16) + 12(0.36)(0.4) + 6(0.216)$$ $$= 0.064 + 0.576 + 1.728 + 1.296 = 3.664$$ $$y = 0.064 + 9(0.6)(0.16) + 9(0.36)(0.4) + 4(0.216)$$ $$= 0.064 + 0.864 + 1.296 + 0.864 = 3.088$$
u = 0.8: $(1-u)=0.2$ $$x = 0.008 + 6(0.8)(0.04) + 12(0.64)(0.2) + 6(0.512)$$ $$= 0.008 + 0.192 + 1.536 + 3.072 = 4.808$$ $$y = 0.008 + 9(0.8)(0.04) + 9(0.64)(0.2) + 4(0.512)$$ $$= 0.008 + 0.288 + 1.152 + 2.048 = 3.496$$
u = 1.0: $x = 6,; y = 4$
Summary Table
| $u$ | $x(u)$ | $y(u)$ |
|---|---|---|
| 0.0 | 1.000 | 1.000 |
| 0.2 | 1.712 | 1.984 |
| 0.4 | 2.616 | 2.632 |
| 0.5 | 3.125 | 2.875 |
| 0.6 | 3.664 | 3.088 |
| 0.8 | 4.808 | 3.496 |
| 1.0 | 6.000 | 4.000 |
The curve starts at $A(1,1)$, ends at $D(6,4)$, and remains within the convex hull of the control polygon, tangent to $AB$ at the start and to $CD$ at the end.
2079 · 5 marks
Explain about parametric curve. Describe the properties of Bezier curve. [5]
2078 · 5 marks
Discuss the strength and weakness of the human visual system. Describe Spline representation for the curve. [5]
2078 · 5 marks
Define fractal. Explain the Bezier curve and B-Spline curve. [5]
Show solved answerHide answer
Fractal, Bezier Curve, and B-Spline Curve
1. Fractal (Definition)
A fractal is a geometric figure or natural phenomenon that exhibits self-similarity at every scale of magnification. This means a fractal looks similar (or identical) when zoomed in or out at any level. Fractals are used in computer graphics to model complex natural shapes such as mountains, clouds, coastlines, and trees that cannot be easily described by classical Euclidean geometry.
Key properties of fractals:
- Self-similarity: Each part resembles the whole.
- Fractional dimension: They have non-integer (fractional) dimensions.
- Infinite detail: They show complexity at every level of magnification.
Example: Koch Snowflake, Sierpinski Triangle, Mandelbrot Set.
2. Bezier Curve
As noted in the reference, the Bezier spline was developed by French engineer Pierre Bezier and is widely used in CAD systems for curve and surface design.
Definition
A Bezier curve is a parametric curve defined using a set of control points. It does not necessarily pass through all control points (except the first and last); instead, it approximates the shape defined by those points.
Blending Functions (Bernstein Polynomials)
For n+1 control points P0, P1, ..., Pn, the Bezier curve is defined as:
$$Q(t) = \sum_{k=0}^{n} P_k \cdot B_{k,n}(t), \quad 0 \leq t \leq 1$$
Where the blending functions (Bernstein basis polynomials) are:
$$B_{k,n}(t) = \binom{n}{k} t^k (1-t)^{n-k}$$
Properties of Bezier Curves
- The curve passes through the first and last control points.
- The curve lies within the convex hull of the control points.
- The degree of the curve is
nforn+1control points. - Changing any one control point affects the entire curve (global control).
- Easy to implement and widely available in CAD systems.
3. B-Spline Curve
As stated in the reference, B-Splines are the most widely used class of approximating splines.
Definition
A B-Spline (Basis Spline) curve is a piecewise polynomial curve defined by a set of control points and a knot vector. It generalizes the Bezier curve and provides greater flexibility.
$$Q(t) = \sum_{k=0}^{n} P_k \cdot N_{k,d}(t)$$
Where:
P_k= control pointsN_{k,d}(t)= B-Spline basis functions of degreed- The basis functions are defined recursively using the Cox-de Boor recursion formula.
Advantages over Bezier Curves
| Feature | Bezier | B-Spline |
|---|---|---|
| Degree vs control points | Degree depends on number of control points | Degree can be set independently of control points |
| Control | Global control | Local control over curve shape |
| Complexity | Simpler | More complex |
Properties of B-Spline Curves
- Provides local control: modifying one control point affects only a portion of the curve.
- The degree of the curve can be chosen independently of the number of control points.
- The curve lies within the convex hull of the control points.
- More flexible for modeling complex shapes.
- Disadvantage: More complex to implement than Bezier splines.
Summary Table
| Feature | Fractal | Bezier Curve | B-Spline Curve |
|---|---|---|---|
| Nature | Self-similar geometric figure | Parametric approximation curve | Piecewise polynomial curve |
| Control | N/A | Global (all control points) | Local (individual control points) |
| Degree | Fractional dimension | Depends on control points | Independent of control points |
| Use | Natural shapes, terrain | CAD, font design | CAD, surface modeling |
2075 · 5 marks
Mention any two color command in OpenGL. Explain about Hermite curve. [5]
Polygon Surface
2080 · 5 marks
Explain polygon surface representation using Polygon table and polygon meshes. [5]
2079 · 5 marks
What is polygon table? Explain the use of this method in 3D object representation. [5]
2078 · 5 marks
What is the task of a polygon table? Why do we have to remove hidden surfaces? Explain with any one methodology. [5]
2077 · 10 marks
How polygon table is used in representing polygons? Explain the representations of any three curves.[10]
Show solved answerHide answer
Polygon Table in Representing Polygons and Curve Representations
Part 1: Polygon Table for Representing Polygons
Polygon Surfaces
The most commonly used boundary representation (B-rep) for a 3D graphics object is a set of surface polygons that enclose the interior of the object. Many graphics systems store all object descriptions as a set of surface polygons because it simplifies and speeds up surface rendering and display.
Polygon Tables
A polygon table is the specification of polygon surfaces using vertex coordinates and other attributes. Polygon data tables are organized into two groups:
- Geometric Tables
- Attribute Tables
Geometric Tables
For storing geometric data, three lists are created:
1. Vertex Table
- Stores the coordinate values (x, y, z) for each vertex in the object.
- Example:
| Vertex | x | y | z |
|---|---|---|---|
| V1 | x1 | y1 | z1 |
| V2 | x2 | y2 | z2 |
| V3 | x3 | y3 | z3 |
| ... | ... | ... | ... |
2. Edge Table
- Contains pointers back into the vertex table to identify the two vertices for each polygon edge.
- Example:
| Edge | Vertex Pointers |
|---|---|
| E1 | V1, V2 |
| E2 | V2, V3 |
| E3 | V3, V1 |
| ... | ... |
3. Polygon Table
- Contains pointers back into the edge table to identify the edges that form each polygon.
- Example:
| Polygon | Edge Pointers |
|---|---|
| P1 | E1, E2, E3 |
| P2 | E3, E4, E5 |
| ... | ... |
Attribute Table
- Contains qualitative properties of each polygon surface such as:
- Degree of transparency
- Surface reflectivity
- Color and texture information
Diagram of Polygon Table Structure
Vertex Table Edge Table Polygon Table
----------- ---------- -------------
V1: (x1,y1,z1) <-- E1: V1,V2 <------ P1: E1,E2,E3
V2: (x2,y2,z2) <-- E2: V2,V3 P2: E3,E4,E5
V3: (x3,y3,z3) <-- E3: V3,V1
This hierarchical pointer structure allows efficient storage and retrieval of polygon geometry for rendering.
Part 2: Representations of Three Curves
1. Spline Curves
Definition: A spline refers to a flexible strip used to produce a smooth curve through a designated set of points. Mathematically, a spline curve is described using a piecewise cubic polynomial function.
Key Concepts:
- Several small weights are distributed along the length of the strip to hold it in position on a drafting table as the curve is drawn.
- The curve passes through or near a set of control points.
- A spline surface can be described with two sets of orthogonal spline curves.
Mathematical Representation: A piecewise cubic polynomial for a segment between two control points is:
P(t) = a*t³ + b*t² + c*t + d, 0 ≤ t ≤ 1
where a, b, c, d are coefficient vectors determined by boundary conditions.
Applications:
- Designing curve and surface shapes in graphics applications.
- Used in CAD/CAM, animation, and font design.
Diagram:
Control Points: P0, P1, P2, P3
P1 * * P2
/ \
P0 * * P3
\_____________/
Spline Curve
2. Bezier Curves
Definition: A Bezier curve is a parametric curve defined by a set of control points. The curve is influenced by all control points but generally does not pass through the intermediate ones (only through the first and last).
Mathematical Representation: For n+1 control points P0, P1, ..., Pn, the Bezier curve is:
P(t) = Σ [C(n,k) * t^k * (1-t)^(n-k) * Pk], 0 ≤ t ≤ 1
k=0 to n
where C(n,k) = n! / (k! * (n-k)!) are the Bernstein basis polynomials.
For a cubic Bezier curve (n=3):
P(t) = (1-t)³P0 + 3t(1-t)²P1 + 3t²(1-t)P2 + t³P3
Properties:
- The curve always passes through P0 and P3 (endpoints).
- The curve lies within the convex hull of the control points.
- Changing one control point affects the entire curve.
Diagram:
P1 *----* P2
/ \
P0 * * P3
\__Bezier__/
3. B-Spline Curves
Definition: A B-Spline (Basis Spline) curve is an extension of the Bezier curve that provides local control over the shape of the curve. Changing one control point affects only a portion of the curve.
Mathematical Representation:
P(t) = Σ Pi * Ni,k(t)
i=0 to n
where:
- Pi are the control points
- Ni,k(t) are the B-Spline basis functions of order k
- The basis functions are defined recursively:
Ni,1(t) = 1, if ti ≤ t < ti+1, else 0
Ni,k(t) = [(t - ti) / (ti+k-1 - ti)] * Ni,k-1(t) + [(ti+k - t) / (ti+k - ti+1)] * Ni+1,k-1(t)
where $t_0, t_1, \ldots, t_{n+k}$ is the sequence of knot values that determines where and how the control points influence the curve.
Properties:
- Provides local control: moving one control point only changes the curve over a limited parameter range (roughly $k$ segments), unlike a Bezier curve where every control point affects the entire curve.
- The degree of the curve (order $k$) is independent of the number of control points, unlike a Bezier curve where the degree is always one less than the number of control points.
- Includes Bezier curves as a special case (a B-Spline with a single knot span and no interior knots reduces to a Bezier curve).
- Widely used in CAD systems and font outlines where localized editing of a complex curve is needed.
Diagram:
P1 * * P3
/ \ / \
P0 * \ / * P4
\_____\/______/
(each control point only reshapes a local segment)
Summary
Together, the polygon table (vertex, edge, polygon and attribute lists) gives an efficient boundary representation for flat-faced 3D objects, while spline, Bezier, and B-Spline curves give three progressively more flexible ways to represent smooth curved surfaces: splines interpolate through control points with piecewise cubics, Bezier curves give a single polynomial influenced by every control point globally, and B-Splines add local control through their knot-based recursive basis functions, which is why B-Splines are preferred whenever a designer needs to edit part of a complex curve without disturbing the rest of it.
Blobby Objects
2079 · 5 marks
What are blobby objects? How it is represented? Explain the wireframe representation of 3D objects. [5]
2077 · 5 marks
Define blobby objects. Describe about basic illumination models. [5]
Quadric Surface
2078 · 5 marks
What is quadric surface? Compare between diffuse reflection and specular reflection. [5]
Wireframe Representation
2075 · 5 marks
What is the purpose of wireframe representation? Describe about boundary and space partitioning. [5]
Make Unit 5 stick
Practice CSC214 with flashcards & quizzes