0% found this document useful (0 votes)
41 views38 pages

3D Object Representation

Uploaded by

AKRITI SHANKAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views38 pages

3D Object Representation

Uploaded by

AKRITI SHANKAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

CA 305: Computer Graphics

Dr. Aparna Shukla


Department of Computer Science and Engineering
BIT, Mesra (Lalpur )
Three Dimentional Object Representation
Introduction
Graphics scenes can contain many different kinds of objects and material
surfaces such asTrees, flowers, clouds, rocks, water, bricks, wood paneling,
rubber, paper, steel, glass, plastic and cloth

• Not possible to have a single representation for all


v Polygon surfaces

v Spline surfaces

v Procedural methods

v Physical models

v Solid object models

v Fractal
3-D Object Representation
3D solid object representation can be classified into two main
categories:

• Boundary Representations (B-reps):

This method describes a 3D object by defining its surface boundaries,


which separate the object's interior from its external environment.
Essentially, it represents the object as a collection of surfaces.

• Space-Partitioning Representations:

This technique focuses on representing the interior properties of an


object by dividing the space containing the object into small, non-
overlapping, contiguous solids, typically using cubes.
Boundary Representation: Polygon Surfaces
• The most widely used method for representing a 3D graphics object is polygonal
representation. This approach defines the object as a set of surface polygons that
enclose its interior.

Example: A cube can be represented by six polygons (quadrilaterals), one for each face
of the cube.

Each polygon is stored as part of the object’s description, which simplifies and speeds
up surface rendering and display. Since polygons can be easily represented using
linear equations, this method allows for efficient computation of the object's shape
and appearance during rendering.
Representation of Polygon Surfaces

A polygon surfaces are boundary representation for a 3D object is a set of polygons


that enclose the object interior.

Three ways to represent polygon surfaces

1. Polygon Tables

2. Plane Equations

3. Polygon Meshe
Polygon Tables
Polygon Tables:

• Maintain the relationship between the vertices to form polygons.

• They can be defined by specifying a set of vertex coordinates along


with corresponding attribute parameters.

• For each polygon input, the data into tables are to be used in the
subsequent processing.

• Polygon tables can be organized into two groups:


1. Geometric Tables: Store the coordinates of the vertices.

2. Attribute Tables: Contain additional information like color, shading, and texture
associated with the polygons.
Polygon Tables: Geometric Tables
Geometric Tables consists
of information related to the
shape and structure of a 3D
object, primarily storing:

• VERTEX TABLE

• EDGE TABLE

• P O LYG O N S U R FAC E
TABLE
Polygon Tables: Geometric Tables
• Extra infor mation can be added to the data tables for faster
information extraction. For instance, edge table can be expanded to
include forward points into the polygontable so that common edges
between polygons can be identified more rapid.

• This approach is useful for smoothly varying surface shading across


polygon edges. The vertex table can be expanded to cross-reference
vertices with edges.
Polygon Tables: Geometric Tables
• Additional geometric data, like edge slopes and polygon coordinate extents, can be
calculated as vertices are input. This helps in identifying minimum and maximum x,
y, and z values for polygons.

• More detailed data tables make error-checking easier.

Some checks include ensuring:

1. Every vertex is an endpoint for at least two edges,

2. Every edge belongs to a polygon,

3. Every polygon is closed,

4. Each polygon shares at least one edge,

5. Edge and polygon pointers are reciprocally referenced.


Plane Equations

• To display a 3D object, the input data is processed through steps like


transforming model coordinates to viewing and device coordinates,
identifying visible surfaces, and applying surface rendering.

• Spatial orientation of the object's surfaces is determined using vertex


coordinates and polygon plane equations.
Plane Equations

The equation for the plane surface can be expressed as


�� + �� + �� + � = 0

where, (x,y,z) is any point on the plane and coefficents A,B,C and D are constants
describing the spatial properties of the plane

Rewritten as :
�� + �� + �� =− �

� � �
�+ �+ � =− 1
� � �
The values of A, B, C, and D for a plane equation can be determined by solving a
system of three equations using the coordinates of three non-collinear points on the
plane.
Plane Equations
Let the three vertices of the plane be given as
(�1 �1 , �1 ), (�2 �2 , �2 ), (�3 �3 , �3 )
We can solve the following system of simultaneous equations to find the ratios. These
ratios will allow us to determine the values of A, B, C and D.

� � �

�� + �
�� + �
�� =− � for (�� ,�� , �� )

� � �

�� + �
�� + �
�� =− � for (�� �� , �� )

� � �

�� + �
�� + �
�� =− � for (�� �� , �� )
Plane Equations
The solution for this set of equations can be obtained in
determinant form, using Cramer’s rule as

1 �1 �1 �1 1 �1 �1 �1 1
�= 1 �2 �2 , B = �2 1 �2 , C = �2 �2 1,
1 �3 �3 �3 1 �3 �3 �3 1

�1 �1 �1
D = �2 �2 �2
�3 �3 �3
Plane Equations
Expanding the determinants, we can write the calculations for the plane
coefficients in the form:
� = �1 (�2 − �3 ) + �2 (�3 − �1 ) + �3 (�1 − �3 )
� = �1 (�2 − �3 ) + �2 (�3 − �1 ) + �3 (�1 − �3 )
� = �1 (�2 − �3 ) + �2 (�3 − �1 ) + �3 (�1 − �3 )
� = −�1 (�2 �3 − �3 �2 )−�2 (�3 �1 − �1 �3 )−�1 (�1 �2 − �2 �1 )
Plane Equations
Plane equations are also used to determine the position of
spatial points in relation to an object's plane surfaces.

�� + �� + �� + � ≠ � , ����� ��� �� ��� ����� ,


�� + �� + �� + � < � , ����� �� ������ ��� ������� ,
�� + �� + �� + � > � , ����� ��� ������� ��� ������� ,
Polygon Meshes
A single plane surface can be defined using a function like fillArea. However, for tiling
multiple object surfaces, it's more convenient to use a mesh function.

Triangle Strip:

A polygon mesh type that forms connected triangles.

For example, a strip with 11 triangles connects 13 vertices. This function creates (n-2)
triangles from n vertices

Quadrilateral Mesh:

Another mesh function that generates a grid of quadrilaterals.

For an n x m array of vertices, it produces (n-1) x(m-1) quadrilaterals.

For instance, 20 vertices can form 12 quadrilaterals.


Polygon Meshes

• When polygons have more than three vertices, some may not lie on
the same plane due to errors.

• To handle this, polyg ons can be divided into triangles or


approximated using plane parameters A, B, and C, based on
projections onto coordinate planes.

• High-end graphics systems use polygon meshes with fast hardware


renderers, capable of displaying millions of shaded polygons (often
triangles) per second, along with textures and lighting effects.
Polygon Meshes
Curved Lines and Surfaces
• In computer graphics, it's common to render various types of objects
on the screen. These objects are not always flat; often, we need to
draw curves to accurately represent the shapes of different objects.

• A curve in computer graphics refers to a continuous and smooth flow


of points that forms a path without sharp edges or abrupt changes.

• Curves are essential for modeling organic shapes, smooth surfaces,


and objects with rounded edges that cannot be efficiently represented
by straight lines.
Curved Lines and Surfaces
• 3D curved lines and surfaces can be generated using mathematical
functions or user-specified data points.

• For surfaces, functions are typically approximated with a polygon


mesh, often using triangular patches to ensure all vertices lie in the
same plane.

Examples- surfaces generated from functions include quadrics and


superquadrics.
Curved Lines and Surfaces
• When objects are defined by discrete points, curve-fitting methods like
splines are used to fit a function to the points.

• These methods are used for designing shapes, digitizing drawings, and
animating paths.

• Curve-fitting techniques, like least-squares regression, are also used to


display graphs of data.

• Parametric equations are preferred for computer graphics due to their


convenience.
Curves Representation

Types of Curve

Explicit Curve Implicit Curve Parametric Curve


y=f(x) f(x,y)=0 (x,y)=f(v)

Example: Line Example: Circle


equation equation

y=mx+c x2+y2-r2=0
Explicit Curve

• A mathematical function y=f(x) can be visualized as a curve.

• This is known as the explicit representation of the curve.

• It typically single-valued. For each x value, the function generally


computes only one corresponding y value.
Implicit Curve

• Implicit curve representations define the points on a curve by using a


method that tests whether a given point lies on the curve.

• A mathematical function f(x,y) = 0 can be visualized as a curve.

• This representation can handle multivalued curves, meaning there can


be multiple y values for a single x value.

• A common example is the circle, whose implicit form is given by:

x^2 + y^2 - R^2 = 0


Parametric Curve
• Curves defined by parametric equations are known as parametric curves.

• While explicit and implicit representations require the function to be known,


parametric curves are more commonly used in practice.

• A two-dimensional parametric curve is expressed as:

P(t) = (f(t), g(t)) ) or P(t) = (x(t), y(t))

Here, the functions f(t) and g(t) represent the (x) and (y) coordinates of any point on
the curve.

• The points are generated by varying the parameter ( t) over a specific interval ([a, b]),
typically ([0, 1]).
Bezier Curve
• A Bezier curve is a parametric curve used in computer graphics and
design for modeling smooth curves.

• It is defined by a set of control points, which influence the curve's


shape but may not lie on the curve itself.
v Inital Poistion (P0)

v Terminating Poistion (P3)

v Two separate middle points (P1 and P2 )

where P0 and P3 are called Anchors

P1 and P2 are called handles

• The simplest forms are linear, quadratic, and cubic Bezier curves.It is
defined by set of four point
Bezier Curve: Example
• A cubic Bezier curve is defined by four control points: P0, P1, P2, P3 .

• The curve begins at P0 and ends at P3 (called achors), with P1​ and P2​
(called handles) controlling the curve's direction and shape.

• The parametric equation for a cubic Bezier curve is:

� (� )=(1−� )3P0+3(1−� )2 � P1+3(1−� )t2 P2+t3 P3

​ where � is a parameter that ranges from 0 to 1.


Quadratics surfaces

• Quadratic surfaces in computer graphics are 3D shapes defined by


second-degree polynomial equations in three variables (x, y, z).

• These surfaces are useful for modeling smooth, curved shapes and can
include various geometric forms such as: sphere, ellipsod, cylinder etc.
Quadratics surfaces: Sphere
• A sphere is a fundamental quadratic surface in computer graphics,
frequently used to model smooth, round objects.

• It is mathematically represented by the equation:

x^2 + y^2 + z^2 = r^2

where (x,y,z) are the coordinates of a point on the surface and r is the
radius of the sphere.

The center of the sphere is typically located at the origin (0,0,0), but it can
be translated to any point (xc,y� ,zc) using the equation

(� −xc)2+(� −yc)2+(� −zc)2=r2


Quadratics surfaces: Sphere
Properties of the Sphere in Computer Graphics:

1. Symmetry: A sphere is perfectly symmetrical around its center, making


it easy to handle computationally.

2. Rendering: In 3D rendering, spheres can be approximated using a


polygonal mesh or parametric equations. Higher resolution meshes
provide smoother surfaces.

3. Applications: Spheres are used in various applications such as


representing planets in simulations, lighting calculations (as point lights),
and collision detection in physics engines.
Quadratics surfaces: Sphere
Parametric Form:

• For rendering purposes, a sphere can also be described in parametric


form:
� = �. ���(∅). ���(�)
� = �. ���(∅). ���(�)
� = �. ���(∅)

� �
where −� ≤ � ≤ �, ��� − 2 ≤ ∅ ≤ 2

• This parametric form allows for smooth rendering by iterating over


angles to generate points on the surface of the sphere.
Quadratics surfaces: Sphere
Use in Computer Graphics:

• Ray Tracing: Spheres are commonly used in ray tracing for simulating
realistic lighting, as their geometric properties make intersection
calculations efficient.

• Subdivision Surface Modeling: In 3D modeling, spheres are created


using subdivision techniques that refine polygonal meshes for higher
detail.

• Spheres are essential in building complex 3D models and scenes due to


their simplicity and versatility.
Quadratics surfaces: Ellipsoid
• An ellipsoidal surface can be described as an extension of a spherical
surface, where the radii in a three mutually perpendicular directions can
have different values.

• An ellipsoid is a type of quadratic surface in computer graphics used to


model objects that are stretched or compressed versions of a sphere.
The mathematical equation for an ellipsoid is:

�2 �2 �2
+ + =1
�2 �2 �2

where, a,b,c are the semi-axes of the ellipsoid along the x,y, and z
directions respectively.
Quadratics surfaces: Ellipsoid

The center of the sphere is typically located at the


origin (0,0,0), but it can be translated to any point
(xc,y� ,zc) using the equation
(�−��)2 (�−��)2 (�−��)2
2 + 2 + =1
� � �2
Quadratics surfaces: Ellipsoid
Properties of the Ellipsoid in Computer Graphics:

1. Symmetry: A ellipsoids is symmetrical around its three prin cipal axis


(x,y,z).When (a=b=c), the ellipsoid becomes sphere.

2. Shape: The values of a, b, and c control the stretching and


compression of the ellipsoid.
Quadratics surfaces: Ellipsoid -Parametric Form
For rendering purposes, a ellipsoid can also be described in parametric
form:
� = �. ���(∅). ���(�)
� = �. ���(∅). ���(�)
� = �. ���(∅)

� �
where −� ≤ � ≤ �, ��� − 2 ≤ ∅ ≤ 2

• This parametric form allows the generation of points on the surface of


the ellipsoid, which can then be used to construct its mesh for
rendering.
Thanks

You might also like