0% found this document useful (0 votes)
11 views22 pages

Unit 4 Computer Graphics

The document discusses various methods for 3D concept and object representation, including parallel and perspective projections, depth cueing, and surface rendering techniques. It also covers polygon surfaces, polygon tables, and plane equations for 3D modeling, as well as the use of polygon meshes for defining shapes in computer graphics. Additionally, it explains stereoscopic views and methods for displaying 3D objects, emphasizing the importance of visibility and depth in rendering realistic images.
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)
11 views22 pages

Unit 4 Computer Graphics

The document discusses various methods for 3D concept and object representation, including parallel and perspective projections, depth cueing, and surface rendering techniques. It also covers polygon surfaces, polygon tables, and plane equations for 3D modeling, as well as the use of polygon meshes for defining shapes in computer graphics. Additionally, it explains stereoscopic views and methods for displaying 3D objects, emphasizing the importance of visibility and depth in rendering realistic images.
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

Unit-4 – 3D Concept & Object Representation

Three Dimensional Display Methods


Parallel Projection
 This method generates view from solid object by projecting parallel lines onto the display plane.
 By changing viewing position we can get different views of 3D object onto 2D display screen.

Fig. 4.1: - different views object by changing viewing plane position.


 Above figure shows different views of objects.
 This technique is used in Engineering & Architecture drawing to represent an object with a set of views
that maintain relative properties of the object e.g.:- orthographic projection.

Perspective projection
 This method generating view of 3D object by projecting point on the display plane along converging
paths.

Fig. 4.2: - perspective projection


 This will display object smaller when it is away from the view plane and of nearly same size when closer
to view plane.
 It will produce more realistic view as it is the way our eye is forming image.

Depth cueing
 Many times depth information is important so that we can identify for a particular viewing direction
which are the front surfaces and which are the back surfaces of display object.

1
Unit-4 – 3D Concept & Object Representation

 Simple method to do this is depth cueing in which assign higher intensity to closer object & lower
intensity to the far objects.
 Depth cuing is applied by choosing maximum and minimum intensity values and a range of distance over
which the intensities are to vary.
 Another application is to modeling effect of atmosphere.

Visible line and surface Identification


 In this method we first identify visible lines or surfaces by some method.
 Then display visible lines with highlighting or with some different color.
 Other way is to display hidden lines with dashed lines or simply not display hidden lines.
 But not drawing hidden lines will loss the some information.
 Similar method we can apply for the surface also by displaying shaded surface or color surface.
 Some visible surface algorithm establishes visibility pixel by pixel across the view plane. Other
determines visibility of object surface as a whole.

Surface Rendering
 More realistic image is produce by setting surface intensity according to light reflect from that surface &
the characteristics of that surface.
 It will give more intensity to the shiny surface and less to dull surface.
 It also applies high intensity where light is more & less where light falls is less.

Exploded and Cutaway views


 Many times internal structure of the object is need to store. For ex., in machine drawing internal
assembly is important.
 For displaying such views it will remove (cutaway) upper cover of body so that internal part’s can be
visible.

Three dimensional stereoscopic views


 This method display using computer generated scenes.
 It may display object by three dimensional views.
 The graphics monitor which are display three dimensional scenes are devised using a technique that
reflects a CRT image from a vibrating flexible mirror.
Projected
3D image
Timing and
Control
System Vibrating
Flexible
Mirror

CRT
Viewer

Fig. 4.3: - 3D display system uses a vibrating mirror.

2
Unit-4 – 3D Concept & Object Representation

 Vibrating mirror changes its focal length due to vibration which is synchronized with the display of an
object on CRT.
 The each point on the object is reflected from the mirror into spatial position corresponding to distance
of that point from a viewing position.
 Very good example of this system is GENISCO SPACE GRAPH system, which use vibrating mirror to
project 3D objects into a 25 cm by 25 cm by 25 cm volume. This system is also capable to show 2D cross
section at different depth.
 Another way is stereoscopic views.
 Stereoscopic views does not produce three dimensional images, but it produce 3D effects by presenting
different view to each eye of an observer so that it appears to have depth.
 To obtain this we first need to obtain two views of object generated from viewing direction
corresponding to each eye.
 We can contract the two views as computer generated scenes with different viewing positions or we can
use stereo camera pair to photograph some object or scene.
 When we see simultaneously both the view as left view with left eye and right view with right eye then
two views is merge and produce image which appears to have depth.
 One way to produce stereoscopic effect is to display each of the two views with raster system on
alternate refresh cycles.
 The screen is viewed through glasses with each lance design such a way that it act as a rapidly
alternating shutter that is synchronized to block out one of the views.

Polygon Surfaces
 A polygonal surface can be thought of as a surface composed of polygonal faces.
 The most commonly used boundary representation for a three dimensional object is a set of polygon
surfaces that enclose the object interior

Polygon Tables
 Representation of vertex coordinates, edges and other property of polygon into table form is called
polygon table.
 Polygon data tables can be organized into two groups: geometric table and attributes table.
 Geometric table contains vertex coordinate and the other parameter which specify geometry of polygon.
 Attributes table stores other information like Color, transparency etc.
 Convenient way to represent geometric table into three different table namely vertex table, edge table,
and polygon table.

3
Unit-4 – 3D Concept & Object Representation

V1

E1
V2 E3
S1 E6
E2
S2
V3 V5

E4 E5

V4

Edge Table
Vertex Table
E1: V1, V2
V1: X1, Y1, Z1 Polygon Surface
E2: V2, V3
V2: X2, Y2, Z2 Table
E3: V3, V1
V3: X3, Y3, Z3 S1: E1, E2, E3
E4: V3, V4
V4: X4, Y4, Z4 S2: E3, E4, E5, E6
E5: V4, V5
V5: X5, Y5, Z5
E6: V5, V1

Fig. 4.4: - Geometric Data Table representation.


 Vertex table stores each vertex included into polygon.
 Edge table stores each edge with the two endpoint vertex pointers back to vertex table.
 Polygon table stores each surface of polygon with edge pointer for the each edge of the surface.
 This three table representation stores each vertex one time only and similarly each edge is also one
time. So it will avoid representation of storing common vertex and edge so it is memory efficient
method.
 Another method to represent with two table vertex table and polygon table but it is inefficient as it will
store common edge multiple times.
 Since tables have many entries for large number of polygon we need to check for consistency as it may
be possible that errors may occurs during input.
 For dealing with that we add extra information into tables. For example figure below shows edge table
of above example with information of the surface in which particular edge is present.

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

Fig. 4.5: - Edge table of above example with extra information as surface pointer.
 Now if any surface entry in polygon table will find edge in edge table it will verify whether this edge is of
particular surface’s edge or not if not it will detect errors and may be correct if sufficient information is
added.

4
Unit-4 – 3D Concept & Object Representation

Plane Equations
 For producing display of 3D objects we must process the input data representation for the object
through several procedures.
 For this processing we sometimes need to find orientation and it can be obtained by vertex coordinate
values and the equation of polygon plane.
 Equation of plane is given as
𝐴𝑥 + 𝐵𝑦 + 𝐶𝑧 + 𝐷 = 0
 Where (x, y, z) is any point on the plane and A, B, C, D are constants by solving three plane equation for
three non collinear points. And solve simultaneous equation for ratio A/D, B/D, and C/D as follows
𝐴 𝐵 𝐶
𝑥1 + 𝑦1 + 𝑧1 = −1
𝐷 𝐷 𝐷
𝐴 𝐵 𝐶
𝑥2 + 𝑦2 + 𝑧2 = −1
𝐷 𝐷 𝐷
𝐴 𝐵 𝐶
𝑥3 + 𝑦3 + 𝑧3 = −1
𝐷 𝐷 𝐷
 Solving by determinant
1 𝑦1 𝑧1 𝑥1 1 𝑧1 𝑥1 𝑦1 1 𝑥1 𝑦1 𝑧1
𝐴 = |1 𝑦2 𝑧2| 𝐵 = |𝑥2 1 𝑧2| 𝐶 = |𝑥2 𝑦2 1| 𝐷 = − |𝑥2 𝑦2 𝑧2|
1 𝑦3 𝑧3 𝑥3 1 𝑧3 𝑥3 𝑦3 1 𝑥3 𝑦3 𝑧3
 By expanding a determinant we get
𝐴 = 𝑦1(𝑧2 − 𝑧3) + 𝑦2(𝑧3 − 𝑧1) + 𝑦3(𝑧1 − 𝑧2)
𝐵 = 𝑧1(𝑥2 − 𝑥3) + 𝑧2(𝑥3 − 𝑥1) + 𝑧3(𝑥1 − 𝑥2)
𝐶 = 𝑥1(𝑦2 − 𝑦3) + 𝑥2(𝑦3 − 𝑦1) + 𝑥3(𝑦1 − 𝑦2)
𝐷 = −𝑥1(𝑦2𝑧3 − 𝑦3𝑧2) − 𝑥2(𝑦3𝑧1 − 𝑦1𝑧3) − 𝑥3(𝑦1𝑧2 − 𝑦2𝑧1)
 This values of A, B, C, D are then store in polygon data structure with other polygon data.
 Orientation of plane is described with normal vector to the plane.

N= (A, B, C)
Y

X
Z
Fig. 4.6: - the vector N normal to the surface.
 Here N= (A,B,C) where A, B, C are the plane coefficient.
 When we are dealing with the polygon surfaces that enclose object interior we define the side of the
faces towards object interior is as inside face and outward side as outside face.
 We can calculate normal vector N for any particular surface by cross product of two vectors in counter
clockwise direction in right handed system then.
𝑁 = (𝑣2 − 𝑣1)𝑋(𝑣3 − 𝑣1)
 Now N gives values A, B, C for that plane and D can be obtained by putting these values in plane
equation for one of the vertices and solving for D.
 Using plane equation in vector form we can obtain D as
𝑁 ∙ 𝑃 = −𝐷
 Plane equation is also used to find position of any point compare to plane surface as follows

5
Unit-4 – 3D Concept & Object Representation

If 𝐴𝑥 + 𝐵𝑦 + 𝐶𝑧 + 𝐷 ≠ 0 the point (x,y,z) is not on that plane.


If 𝐴𝑥 + 𝐵𝑦 + 𝐶𝑧 + 𝐷 < 0 the point (x,y,z) is inside the surface.
If 𝐴𝑥 + 𝐵𝑦 + 𝐶𝑧 + 𝐷 > 0 the point (x,y,z) is outside the surface.
 These equation are valid for right handed system provides plane parameter A, B, C, and D were
calculated using vertices selected in a counter clockwise order when viewing the surface in an outside to
inside direction.

Polygon Meshes

Fig. 4.7: -A triangle strip formed with 11 triangle Fig. 4.8: -A quadrilateral mesh containing 12 quadrilaterals
connecting 13 vertices constructed from a 5 by 4 input vertex array
 Polygon mesh is a collection of edges, vertices and faces that defines the shape of the polyhedral object
in 3D computer graphics and solid modeling.
 An edge can be shared by two or more polygons and vertex is shared by at least two edges.
 Polygon mesh is represented in following ways
o Explicit representation
o Pointer to vertex list
o Pointer to edge list

Explicit Representation
 In explicit representation each polygon stores all the vertices in order in the memory as,
𝑃 = (((𝑥1, 𝑦1, 𝑧1), (𝑥2, 𝑦2, 𝑧2)), … , ((𝑥𝑚, 𝑦𝑚, 𝑧𝑚), (𝑥𝑛, 𝑦𝑛, 𝑧𝑛)))
 It process fast but requires more memory for storing.

Pointer to Vertex list


 In this method each vertex stores in vertex list and then polygon contains pointer to the required vertex.
𝑉 = ((𝑥1, 𝑦1, 𝑧1), (𝑥2, 𝑦2, 𝑧2), … , (𝑥𝑛, 𝑦𝑛, 𝑧𝑛))
 And now polygon of vertices 3, 4, 5 is represented as 𝑃 = ((𝑣3, 𝑣4), (𝑣4, 𝑣5), (𝑣5, 𝑣3)).
 It is considerably space saving but common edges is difficult to find.

Pointer to Edge List


 In this polygon have pointers to the edge list and edge list have pointer to vertex list for each edge two
vertex pointer is required which points in vertex list.
𝑉 = ((𝑥1, 𝑦1, 𝑧1), (𝑥2, 𝑦2, 𝑧2), … , (𝑥𝑛, 𝑦𝑛, 𝑧𝑛))
𝐸 = ((𝑣1, 𝑣2), (𝑣2, 𝑣3), … , (𝑣𝑛, 𝑣𝑚))
𝑃 = (𝐸1, 𝐸2, 𝐸𝑛)
 This approach is more memory efficient and easy to find common edges.

Spline Representations
 Spline is flexible strip used to produce a smooth curve through a designated set of points.
 Several small weights are attached to spline to hold in particular position.
 Spline curve is a curve drawn with this method.

6
Unit-4 – 3D Concept & Object Representation

 The term spline curve now referred to any composite curve formed with polynomial sections satisfying
specified continuity condition at the boundary of the pieces.
 A spline surface can be described with two sets of orthogonal spline curves.

Interpolation and approximation splines


 We specify spline curve by giving a set of coordinate positions called control points. This indicates the
general shape of the curve.
 Interpolation Spline: - When curve section passes through each control point, the curve is said to
interpolate the set of control points and that spline is known as Interpolation Spline.

Fig. 4.9: -interpolation spline. Fig. 4.10: -Approximation spline.

 Approximation Spline: - When curve section follows general control point path without necessarily
passing through any control point, the resulting curve is said to approximate the set of control points
and that curve is known as Approximation Spline.
 Spline curve can be modified by selecting different control point position.
 We can apply transformation on the curve according to need like translation scaling etc.
 The convex polygon boundary that encloses a set of control points is called convex hull.

Fig. 4.11: -convex hull shapes for two sets of control points.
 A poly line 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 as
control graph of the curve.
 Control graph is also referred as control polygon or characteristic polygon.

7
Unit-4 – 3D Concept & Object Representation

Fig. 4.12: -Control-graph shapes for two different sets of control points.

Parametric continuity condition


 For smooth transition from one curve section on to next curve section we put various continuity
conditions at connection points.
 Let parametric coordinate functions as
𝑥 = 𝑥(𝑢), 𝑦 = 𝑦(𝑢), 𝑧 = 𝑧(𝑢) ∵ 𝑢1 ≪ 𝑢 ≪ 𝑢2
 0
Then zero order parametric continuity (c ) means simply curves meets i.e. last point of first curve
section & first points of second curve section are same.
 First order parametric continuity (c1) means first parametric derivatives are same for both curve section
at intersection points.
 Second order parametric continuity (c2) means both the first & second parametric derivative of two
curve section are same at intersection.
 Higher order parametric continuity is can be obtain similarly.

Fig. 4.13: - Piecewise construction of a curve by joining two curve segments uses different orders of
continuity: (a) zero-order continuity only, (b) first-order continuity, and (c) second-order continuity.
 First order continuity is often sufficient for general application but some graphics package like cad
requires second order continuity for accuracy.

Geometric continuity condition


 Another method for joining two successive curve sections is to specify condition for geometric
continuity.
 Zero order geometric continuity (g0) is same as parametric zero order continuity that two curve section
meets.
 First order geometric continuity (g1) means that the parametric first derivatives are proportional at the
intersection of two successive sections but does not necessary Its magnitude will be equal.
 Second order geometric continuity (g2) means that the both parametric first & second derivatives are
proportional at the intersection of two successive sections but does not necessarily magnitude will be
equal.

8
Unit-4 – 3D Concept & Object Representation

Cubic Spline Interpolation Methods


 Cubic splines are mostly used for representing path of moving object or existing object shape or drawing.
 Sometimes it also used for design the object shapes.
 Cubic spline gives reasonable computation on as compared to higher order spline and more stable
compare to lower order polynomial spline. So it is often used for modeling curve shape.
 Cubic interpolation splines obtained by fitting the input points with piecewise cubic polynomial curve
that passes through every control point.

Fig. 4.14: -A piecewise continuous cubic-spline interpolation of n+1 control points.


𝑝𝑘 = (𝑥𝑘, 𝑦𝑘, 𝑧𝑘) Where, k=0, 1, 2, 3 ..., n
 Parametric cubic polynomial for this curve is given by
𝑥(𝑢) = 𝑎𝑥𝑢3 + 𝑏𝑥𝑢2 + 𝑐𝑥𝑢 + 𝑑𝑥
𝑦(𝑢) = 𝑎𝑦𝑢3 + 𝑏𝑦𝑢2 + 𝑐𝑦𝑢 + 𝑑𝑦
𝑧(𝑢) = 𝑎𝑧𝑢3 + 𝑏𝑧𝑢2 + 𝑐𝑧𝑢 + 𝑑𝑧
𝑤ℎ𝑒𝑟𝑒( 0 ≤ 𝑢 ≤ 1)
 For above equation we need to determine for constant a, b, c and d the polynomial representation for
each of n curve section.
 This is obtained by settling proper boundary condition at the joints.
 Now we will see common method for settling this condition.

Natural Cubic Splines


 Natural cubic spline is a mathematical representation of the original drafting spline.
 We consider that curve is in 𝑐2 continuity means first and second parametric derivatives of adjacent
curve section are same at control point.
 For the ‘’n+1’’ control point we have n curve section and 4n polynomial constants to find.
 For all interior control points we have four boundary conditions. The two curve section on either side of
control point must have same first & second order derivative at the control points and each curve passes
through that control points.
 We get other two condition as 𝑝0 (first control points) starting & 𝑝𝑛(last control point) is end point of the
curve.
 We still required two conditions for obtaining coefficient values.
 One approach is to setup second derivative at 𝑝0 & 𝑝𝑛 to be 0. Another approach is to add one extra
dummy point at each end. I.e. we add 𝑝−1 & 𝑝𝑛+1 then all original control points are interior and we get
4n boundary condition.
 Although it is mathematical model it has major disadvantage is with change in the control point entire
curve is changed.
 So it is not allowed for local control and we cannot modify part of the curve.

Hermit Interpolation
 It is named after French mathematician Charles hermit

9
Unit-4 – 3D Concept & Object Representation

 It is an interpolating piecewise cubic polynomial with specified tangent at each control points.
 It is adjusted locally because each curve section is depends on it’s end points only.
 Parametric cubic point function for any curve section is then given by:
𝑝(0) = 𝑝𝑘
𝑝(1) = 𝑝𝑘+1
𝑝′(0) = 𝑑𝑝𝑘
𝑝′′(1) = 𝑑𝑝𝑘+1
Where dpk & dpk+1 are values of parametric derivatives at point pk & pk+1 respectively.
 Vector equation of cubic spline is:
𝑝(𝑢) = 𝑎𝑢3 + 𝑏𝑢2 + 𝑐𝑢 + 𝑑
 Where x component of p is
 𝑥(𝑢) = 𝑎𝑥𝑢3 + 𝑏𝑥𝑢2 + 𝑐𝑥𝑢 + 𝑑𝑥 and similarly y & z components
 Matrix form of above equation is
𝑎
𝑏
𝑃(𝑢) = [𝑢3 𝑢2 𝑢 1] [ ]
𝑐
𝑑
 Now derivatives of p(u) is p’(u)=3au2+2bu+c+0
 Matrix form of p’(u) is
𝑎
𝑏
𝑃′(𝑢) = [3𝑢2 2𝑢 1 0] [ ]
𝑐
𝑑
 Now substitute end point value of u as 0 & 1 in above equation & combine all four parametric equations
in matrix form:
𝑝𝑘 0 0 0 1 𝑎
𝑝𝑘+1 𝑏
[ ] = [1 1 1 1] [ ]
𝑑𝑝𝑘 0 0 1 0 𝑐
𝑑𝑝𝑘+1 3 2 1 0 𝑑
 Now solving it for polynomial co efficient
𝑎 2 −2 1 1 𝑝𝑘
𝑏 𝑝𝑘+1
−3 3 −2 −1
[ ] =[ 0 0 1 0
] [ 𝑑𝑝 ]
𝑐 𝑘
𝑑 1 0 0 0 𝑑𝑝𝑘+1
𝑎 𝑝𝑘
𝑏 𝑝𝑘+1
[ 𝑐 ] = 𝑀𝐻 [ 𝑑𝑝𝑘 ]
𝑑 𝑑𝑝𝑘+1
 Now Put value of above equation in equation of 𝑝(𝑢)
2 −2 1 1 𝑝𝑘
−3 3 −2 −1 𝑝𝑘+1
𝑝(𝑢) = [𝑢3 𝑢2 𝑢 1] [ ][ ]
0 0 1 0 𝑑𝑝 𝑘

1 0 0 0 𝑑𝑝𝑘+1
𝑝𝑘
𝑝𝑘+1
𝑝(𝑢) = [2𝑢3 − 3𝑢2 + 1 − 2𝑢3 + 3𝑢2 𝑢3 − 2𝑢2 + 𝑢 𝑢3 − 𝑢2] [ ]
𝑑𝑝𝑘
𝑑𝑝𝑘+1
𝑝(𝑢) = 𝑝𝑘(2𝑢3 − 3𝑢2 + 1) + 𝑝𝑘+1(−2𝑢3 + 3𝑢2 ) + 𝑑𝑝𝑘(𝑢3 − 2𝑢2 + 𝑢) + 𝑑𝑝𝑘+1(𝑢3 − 𝑢2)
𝑝(𝑢) = 𝑝𝑘𝐻0(u) + 𝑝𝑘+1𝐻1(u) + 𝑑𝑝𝑘𝐻2(u) + 𝑑𝑝𝑘+1𝐻3(u)
Where 𝐻𝑘(u) for k=0 , 1 , 2 , 3 are referred to as blending functions because that blend the boundary
constraint values for curve section.

10
Unit-4 – 3D Concept & Object Representation

 Shape of the four hermit blending function is given below.

Fig. 4.15: -the hermit blending functions.


 Hermit curves are used in digitizing application where we input the approximate curve slope means DPk
& DPk+1.
 But in application where this input is difficult to approximate at that place we cannot use hermit curve.

Cardinal Splines
 As like hermit spline cardinal splines also interpolating piecewise cubics with specified endpoint tangents
at the boundary of each section.
 But in this spline we need not have to input the values of endpoint tangents.
 In cardinal spline values of slope at control point is calculated from two immediate neighbor control
points.
 It’s spline section is completely specified by the 4-control points.

Fig. 4.16: -parametric point function p(u) for a cardinal spline section between control points pk and pk+1.
 The middle two are two endpoints of curve section and other two are used to calculate slope of
endpoints.
 Now parametric equation for cardinal spline is:
𝑝(0) = 𝑝𝑘
𝑝(1) = 𝑝 1𝑘+1
𝑝′(0) = (1 − 𝑡)(𝑝 −𝑝 )
𝑘+1 𝑘−1
2
1
𝑝 (1) = (1 − 𝑡)(𝑝
′ −𝑝 )
𝑘+2 𝑘
2

11
Unit-4 – 3D Concept & Object Representation

Where parameter t is called tension parameter since it controls how loosely or tightly the cardinal spline
fit the control points.

Fig. 4.17: -Effect of the tension parameter on the shape of a cardinal spline section.
 When t = 0 this class of curve is referred to as catmull-rom spline or overhauser splines.
 Using similar method like hermit we can obtain:
𝑝𝑘−1
𝑝𝑘
𝑝(𝑢) = [𝑢3 𝑢2 𝑢 1] ∙ 𝑀𝑐 ∙ [𝑝𝑘+1]
𝑝𝑘+2
 Where the cardinal matrix is
−𝑠 2 − 𝑠 𝑠 − 2 𝑠
𝑀𝑐 = [ 2𝑠 𝑠 − 3 3 − 2𝑠 −𝑠 ]
−𝑠 0 𝑠 0
0 1 0 0
 With 𝑠 = (1 − 𝑡)⁄2
 Put value of Mc in equation of p(u)
−𝑠 2 − 𝑠 𝑠 − 2 𝑠 𝑝𝑘−1
2𝑠 𝑠 − 3 3 − 2𝑠 −𝑠
𝑝(𝑢) = [𝑢 3 2
𝑢 𝑢 1] ∙ [ ] ∙ [ 𝑝𝑘
−𝑠 0 𝑠 0 𝑝𝑘+1]
0 1 0 0 𝑝𝑘+2
𝑝(𝑢) = [−𝑠𝑢3 + 2𝑠𝑢2 − 𝑠𝑢 (2 − 𝑠)𝑢3 + (𝑠 − 3)𝑢2 + 1 (𝑠 − 2)𝑢3 + (3 − 𝑠)𝑢2 + 𝑠𝑢 𝑠𝑢3 − 𝑠𝑢2]
𝑝𝑘−1
𝑝𝑘
∙ [𝑝 ]
𝑘+1
𝑝𝑘+2
𝑝(𝑢) = 𝑝𝑘−1(−𝑠𝑢3 + 2𝑠𝑢2 − 𝑠𝑢) + 𝑝𝑘((2 − 𝑠)𝑢3 + (𝑠 − 3)𝑢2 + 1)
+ 𝑝𝑘+1((𝑠 − 2)𝑢3 + (3 − 𝑠)𝑢2 + 𝑠𝑢) + 𝑝𝑘+2(𝑠𝑢3 − 𝑠𝑢2)
𝑝(𝑢) = 𝑝𝑘−1𝐶𝐴𝑅0(𝑢) + 𝑝𝑘𝐶𝐴𝑅1(𝑢) + 𝑝𝑘+1𝐶𝐴𝑅2(𝑢) + 𝑝𝑘+2𝐶𝐴𝑅3(𝑢)
Where polynomial 𝐶𝐴𝑅𝑘(𝑢) 𝑓𝑜𝑟 𝑘 = 0,1,2,3 are the cardinals blending functions.
 Figure below shows this blending function shape for t = 0.

12
Unit-4 – 3D Concept & Object Representation

Fig. 4.18: -The cardinal blending function for t=0 and s=0.5.

Kochanek-Bartels spline
 It is extension of cardinal spline
 Two additional parameters are introduced into the constraint equation for defining kochanek-Bartels
spline to provide more flexibility in adjusting the shape of curve section.
 For this parametric equations are as follows:
𝑝(0) = 𝑝𝑘
𝑝(1) = 𝑝 1𝑘+1
𝑝′(0) = (1 − 𝑡)[(1 + 𝑏)(1 − 𝑐)(𝑝 − 𝑝 ) + (1 − 𝑏)(1 + 𝑐)(𝑝 − 𝑝 )]
𝑘 𝑘−1 𝑘+1 𝑘
2
1
𝑝 (1) = (1 − 𝑡)[(1 + 𝑏)(1 + 𝑐)(𝑝

− 𝑝 ) + (1 − 𝑏)(1 − 𝑐)(𝑝 − 𝑝 )]
𝑘+1 𝑘 𝑘+2 𝑘+1
2
Where ‘t’ is tension parameter same as used in cardinal spline.
 B is bias parameter and C is the continuity parameter.
 In this spline parametric derivatives may not be continuous across section boundaries.
 Bias B is used to adjust the amount that the curve bends at each end of section.

Fig. 4.19: -Effect of bias parameter on the shape of a Kochanek-Bartels spline section.
 Parameter c is used to controls continuity of the tangent vectors across the boundaries of section. If C is
nonzero there is discontinuity in the slope of the curve across section boundaries.

13
Unit-4 – 3D Concept & Object Representation

 It is used in animation paths in particular abrupt change in motion which is simulated with nonzero
values for parameter C.

Bezier Curves and Surfaces


 It is developed by French engineer Pierre Bezier for the Renault automobile bodies.
 It has number of properties and easy to implement so it is widely available in various CAD and graphics
package.

Bezier Curves
 Bezier curve section can be fitted to any number of control points.
 Number of control points and their relative position gives degree of the Bezier polynomials.
 With the interpolation spline Bezier curve can be specified with boundary condition or blending function.
 Most convenient method is to specify Bezier curve with blending function.
 Consider we are given n+1 control point position from p0 to pn where pk = (xk, yk, zk).
 This is blended to gives position vector p(u) which gives path of the approximate Bezier curve is:
𝑛

𝑝(𝑢) = ∑ 𝑝𝑘𝐵𝐸𝑍𝑘,𝑛(𝑢) 0≤𝑢≤1


𝑘=0
Where 𝐵𝐸𝑍𝑘,𝑛(𝑢) = 𝐶(𝑛, 𝑘)𝑢𝑘(1 − 𝑢)𝑛−𝑘
And 𝐶(𝑛, 𝑘) = 𝑛!⁄𝑘! (𝑛 − 𝑘)!
 We can also solve Bezier blending function by recursion as follow:
𝐵𝐸𝑍𝑘,𝑛(𝑢) = (1 − 𝑢)𝐵𝐸𝑍𝑘,𝑛−1(𝑢) + 𝑢𝐵𝐸𝑍𝑘−1,𝑛−1(𝑢) 𝑛>𝑘≥1
Here 𝐵𝐸𝑍𝑘,𝑘(𝑢) = 𝑢𝑘 and 𝐵𝐸𝑍0,𝑘(𝑢) = (1 − 𝑢)𝑘
 Parametric equation from vector equation can be obtain as follows.
𝑛

𝑥(𝑢) = ∑ 𝑥𝑘𝐵𝐸𝑍𝑘,𝑛(𝑢)
𝑘=0
𝑛

𝑦(𝑢) = ∑ 𝑦𝑘𝐵𝐸𝑍𝑘,𝑛(𝑢)
𝑘=0
𝑛

𝑧(𝑢) = ∑ 𝑧𝑘𝐵𝐸𝑍𝑘,𝑛(𝑢)
𝑘=0
 Bezier curve is a polynomial of degree one less than the number of control points.
 Below figure shows some possible curve shapes by selecting various control point.

14
Unit-4 – 3D Concept & Object Representation

Fig. 4.20: -Example of 2D Bezier curves generated by different number of control points.
 Efficient method for determining coordinate positions along a Bezier curve can be set up using recursive
calculation
 For example successive binomial coefficients can be calculated as
𝑛−𝑘+1
𝐶(𝑛, 𝑘) = 𝐶(𝑛, 𝑘 − 1) 𝑛≥𝑘
𝑘

Properties of Bezier curves


 It always passes through first control point i.e. p(0) = p0
 It always passes through last control point i.e. p(1) = pn
 Parametric first order derivatives of a Bezier curve at the endpoints can be obtain from control point
coordinates as:
𝑝′(0) = −𝑛𝑝0 + 𝑛𝑝1
𝑝′(1) = −𝑛𝑝𝑛−1 + 𝑛𝑝𝑛
 Parametric second order derivatives of endpoints are also obtained by control point coordinates as:
𝑝′′(0) = 𝑛(𝑛 − 1)[(𝑝2 − 𝑝1) − (𝑝1 − 𝑝0)]
𝑝′′(1) = 𝑛(𝑛 − 1)[(𝑝𝑛−2 − 𝑝𝑛−1) − (𝑝𝑛−1 − 𝑝𝑛)]
 Bezier curve always lies within the convex hull of the control points.
 Bezier blending function is always positive.
 Sum of all Bezier blending function is always 1.
𝑛

∑ 𝐵𝐸𝑍𝑘,𝑛(𝑢) = 1
𝑘=0
 So any curve position is simply the weighted sum of the control point positions.
 Bezier curve smoothly follows the control points without erratic oscillations.

Design Technique Using Bezier Curves


 For obtaining closed Bezier curve we specify first and last control point at same position.

15
Unit-4 – 3D Concept & Object Representation

P3

P2

P4
P1
P0=P5

Fig. 4.21: -A closed Bezier Curve generated by specifying the first and last control points at the same
location.
 If we specify multiple control point at same position it will get more weight and curve is pull towards
that position.
P3
P1=P2

P0

P4

Fig. 4.22: -A Bezier curve can be made to pass closer to a given coordinate position by assigning multiple
control point at that position.
 Bezier curve can be fitted for any number of control points but it requires higher order polynomial
calculation.
 Complicated Bezier curve can be generated by dividing whole curve into several lower order polynomial
curves. So we can get better control over the shape of small region.
 Since Bezier curve passes through first and last control point it is easy to join two curve sections with
zero order parametric continuity (C0).
 For first order continuity we put end point of first curve and start point of second curve at same position
and last two points of first curve and first two point of second curve is collinear. And second control
point of second curve is at position
𝑝𝑛 + (𝑝𝑛 − 𝑝𝑛−1)
 So that control points are equally spaced.

16
Unit-4 – 3D Concept & Object Representation

Fig. 4.23: -Zero and first order continuous curve by putting control point at proper place.
 Similarly for second order continuity the third control point of second curve in terms of position of the
last three control points of first curve section as
𝑝𝑛−2 + 4(𝑝𝑛 − 𝑝𝑛−1)
 C2 continuity can be unnecessary restrictive especially for cubic curve we left only one control point for
adjust the shape of the curve.

Cubic Bezier Curves


 Many graphics package provides only cubic spline function because this gives reasonable design
flexibility in average calculation.
 Cubic Bezier curves are generated using 4 control points.
 4 blending function obtained by substituting n=3
𝐵𝐸𝑍0,3(𝑢) = (1 − 𝑢)3
𝐵𝐸𝑍1,3(𝑢) = 3𝑢(1 − 𝑢)2
𝐵𝐸𝑍2,3(𝑢) = 3𝑢2(1 − 𝑢)
𝐵𝐸𝑍3,3(𝑢) = 𝑢3
 Plots of this Bezier blending function are shown in figure below

Fig. 4.24: -Four Bezier blending function for cubic curve.

17
Unit-4 – 3D Concept & Object Representation

 The form of blending functions determines how control points affect the shape of the curve for values of
parameter u over the range from 0 to 1.
At u = 0 𝐵𝐸𝑍0,3(𝑢) is only nonzero blending function with values 1.
At u = 1 𝐵𝐸𝑍3,3(𝑢) is only nonzero blending function with values 1.
 So the cubic Bezier curve is always pass through p0 and p3.
 Other blending function is affecting the shape of the curve in intermediate values of parameter u.
 𝐵𝐸𝑍1,3(𝑢) is maximum at 𝑢 = 1⁄3and 𝐵𝐸𝑍2,3(𝑢) is maximum at 𝑢 = 2⁄3
 Blending function is always nonzero over the entire range of u so it is not allowed for local control of the
curve shape.
 At end point positions parametric first order derivatives are :
𝑝′(0) = 3(𝑝1 − 𝑝0)
𝑝′(1) = 3(𝑝3 − 𝑝2)
 And second order parametric derivatives are.
𝑝′′(0) = 6(𝑝0 − 2𝑝1 + 𝑝2)
𝑝′′(1) = 6(𝑝1 − 2𝑝2 + 𝑝3)
 This expression can be used to construct piecewise curve with C1 and C2 continuity.
 Now we represent polynomial expression for blending function in matrix form:
𝑝0
𝑝1
𝑝(𝑢) = [𝑢3 𝑢2 𝑢 1] ∙ 𝑀𝐵𝐸𝑍 ∙
[𝑝 ]
2
𝑝3
−1 3 −3 1
𝑀𝐵𝐸𝑍 = [ 3 −6 3 0]
−3 3 0 0
1 0 0 0
 We can add additional parameter like tension and bias as we did with the interpolating spline.

Bezier Surfaces
 Two sets of orthogonal Bezier curves can be used to design an object surface by an input mesh of control
points.
 By taking Cartesian product of Bezier blending function we obtain parametric vector function as:
𝑚 𝑛

𝑝(𝑢, 𝑣) = ∑ ∑ 𝑝𝑗,𝑘𝐵𝐸𝑍𝑗,𝑚(𝑣)𝐵𝐸𝑍𝑘,𝑛(𝑢)
𝑗=0 𝑘=0
 𝑝𝑗,𝑘 Specifying the location of the (m+1) by (n+1) control points.
 Figure below shows Bezier surfaces plot, control points are connected by dashed line and curve is
represented by solid lines.

Fig. 4.25: -Bezier surfaces constructed for (a) m=3, n=3, and (b) m=4, n=4. Dashed line connects the
control points.

18
Unit-4 – 3D Concept & Object Representation

 Each curve of constant u is plotted by varying v over interval 0 to 1. And similarly we can plot for
constant v.
 Bezier surfaces have same properties as Bezier curve, so it can be used in interactive design application.
 For each surface patch we first select mesh of control point XY and then select elevation in Z direction.
 We can put two or more surfaces together and form required surfaces using method similar to curve
section joining with continuity C0, C1, and C2 as per need.

B-Spline Curves and Surfaces


 B-Spline is most widely used approximation spline.
 It has two advantage over Bezier spline
1. Degree of a B-Spline polynomial can be set independently of the number of control points (with
certain limitation).
2. B-Spline allows local control.
 Disadvantage of B-Spline curve is more complex then Bezier spline

B-Spline Curves
 General expression for B-Spline curve in terms of blending function is given by:
𝑛

𝑝(𝑢) = ∑ 𝑝𝑘𝐵𝑘,𝑑(𝑢) 𝑢𝑚𝑖𝑛 ≤ 𝑢 ≤ 𝑢𝑚𝑎𝑥, 2 ≤ 𝑑 ≤ 𝑛 + 1


𝑘=0
Where pk is input set of control points.
 The range of parameter u is now depends on how we choose the B-Spline parameters.
 B-Spline blending function Bk,d are polynomials of degree d-1 , where d can be any value in between 2 to
n+1.
 We can set d=1 but then curve is only point plot.
 By defining blending function for subintervals of whole range we can achieve local control.
 Blending function of B-Spline is solved by Cox-deBoor recursion formulas as follows.
1
𝐵𝑘,1 (𝑢) = {0 𝑖𝑓 𝑢𝑘 ≤ 𝑢 ≤ 𝑢𝑘+1
𝑢 − 𝑢𝑘 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒𝑢
𝑘+𝑑 − 𝑢
𝐵 (𝑢) = 𝐵 (𝑢) + 𝐵 (𝑢)
𝑘,𝑑 𝑢𝑘+𝑑−1 − 𝑢𝑘 𝑘,𝑑−1 𝑢𝑘+𝑑 − 𝑢𝑘+1 𝑘+1,𝑑−1
 The selected set of subinterval endpoints 𝑢𝑗 is reffered to as a knot vector.
 We can set any value as a subinterval end point but it must follow 𝑢𝑗 ≤ 𝑢𝑗+1
 Values of 𝑢𝑚𝑖𝑛 and 𝑢𝑚𝑎𝑥 depends on number of control points, degree d, and knot vector.
 Figure below shows local control

Fig. 4.26: -Local modification of B-Spline curve.


 B-Spline allows adding or removing control points in the curve without changing the degree of curve.
 B-Spline curve lies within the convex hull of at most d+1 control points so that B-Spline is tightly bound
to input positions.

19
Unit-4 – 3D Concept & Object Representation

 For any u in between 𝑢𝑑−1 to 𝑢𝑛+1, sum of all blending function is 1 i.e. ∑𝑘=0
𝑛 𝐵𝑘,𝑑(𝑢) = 1
 There are three general classification for knot vectors:
o Uniform
o Open uniform
o Non uniform

Properties of B-Spline Curves


 It has degree d-1 and continuity Cd-2 over range of u.
 For n+1 control point we have n+1 blending function.
 Each blending function 𝐵𝑘,𝑑(𝑢) is defined over d subintervals of the total range of u, starting at knot
value uk.
 The range of u is divided into n+d subintervals by the n+d+1 values specified in the knot vector.
 With knot values labeled as {𝑢0, 𝑢1, … , 𝑢𝑛+𝑑} the resulting B-Spline curve is defined only in interval from
knot values 𝑢𝑑−1 up to knot values 𝑢𝑛+1
 Each spline section is influenced by d control points.
 Any one control point can affect at most d curve section.

Uniform Periodic B-Spline


 When spacing between knot values is constant, the resulting curve is called a uniform B-Spline.
 For example {0.0,0.1,0.2, … ,1.0} or {0,1,2,3,4,5,6,7}
 Uniform B-Spline have periodic blending function. So for given values of n and d all blending function has
same shape. And each successive blending function is simply a shifted version of previous function.
𝐵𝑘,𝑑(𝑢) = 𝐵𝑘+1,𝑑(𝑢 + ∆𝑢) = 𝐵𝑘+2,𝑑(𝑢 + 2∆𝑢)
Where ∆𝑢 is interval between adjacent knot vectors.

Cubic Periodic B-Spline


 It commonly used in many graphics packages.
 It is particularly useful for generating closed curve.
 If any three consecutive control points are identical the curve passes through that coordinate position.
 Here for cubic curve d = 4 and n = 3 knot vector spans d+n+1 =4+3+1=8 so it is {0,1,2,3,4,5,6,7}
 Now boundary conditions for cubic B-Spline curve is obtain from equation.
𝑛

𝑝(𝑢) = ∑ 𝑝𝑘𝐵𝑘,𝑑(𝑢) 𝑢𝑚𝑖𝑛 ≤ 𝑢 ≤ 𝑢𝑚𝑎𝑥, 2 ≤ 𝑑 ≤ 𝑛 + 1


𝑘=0
 That are
1
𝑝(0) = (𝑝 + 4𝑝 + 𝑝 )
6 0
1
1 2
𝑝(1) = (𝑝 + 4𝑝 + 𝑝 )
61 1 2 3
𝑝′(0) = (𝑝 − 𝑝 )
2 2
1
0
𝑝′(1) = (𝑝 − 𝑝 )
2 3 1

 Matrix formulation for a cubic periodic B-Splines with the four control points can then be written as
𝑝0
𝑝1
𝑝(𝑢) = [𝑢3 𝑢2 𝑢 1] ∙ 𝑀𝐵 ∙
[𝑝 ]
2
𝑝3

20
Unit-4 – 3D Concept & Object Representation

Where
−1 3 −3 1
1 3 −6 3 0
𝑀𝐵 = [ ]
6 −3 0 3 0
1 4 1 0
 We can also modify the B-Spline equation to include a tension parameter t.
 The periodic cubic B-Spline with tension matrix then has the form:
−𝑡 12 − 9𝑡 9𝑡 − 12 𝑡
1 3𝑡 12𝑡 − 18 18 − 15𝑡 0
𝑀𝐵𝑡 = [ ]
6 −3𝑡 0 3𝑡 0
𝑡 6 − 2𝑡 𝑡 0
When t = 1 𝑀𝐵𝑡 = 𝑀𝐵
 We can obtain cubic B-Spline blending function for parametric range from 0 to 1 by converting matrix
representation
1 into polynomial form for t = 1 we have
𝐵 ( ) 3
0,3 𝑢
= (1 − 𝑢)
6
1
𝐵1,3 (𝑢) = (3𝑢3 − 6𝑢2 + 4)
6
1
𝐵2,3 (𝑢) = (−3𝑢3 + 3𝑢2 + 3𝑢 + 1)
6
1
𝐵3,3 (𝑢) = 𝑢3
6

Open Uniform B-Splines


 This class is cross between uniform B-Spline and non uniform B-Splines.
 Sometimes it is treated as a special type of uniform B-Spline, and sometimes as non uniform B-Spline
 For open uniform B-Spline (open B-Spline) the knot spacing is uniform except at the ends where knot
values are repeated d times.
 For example {0,0,1,2,3,3} for d=2 and n=3, and {0,0,0,0,1,2,2,2,2} for d=4 and n=4.
 For any values of parameter d and n we can generate an open uniform knot vector with integer values
using the calculations as follow:
0, 𝑓𝑜𝑟 0 ≤ 𝑗 < 𝑑
𝑢𝑗 = {𝑗 − 𝑑 + 1 𝑓𝑜𝑟 𝑑 ≤ 𝑗 ≤ 𝑛
𝑛−𝑑+2 𝑓𝑜𝑟 𝑗 > 𝑛
Where 0 ≤ 𝑗 ≤ 𝑛 + 𝑑
 Open uniform B-Spline is similar to Bezier spline if we take d=n+1 it will reduce to Bezier spline as all
knot values are either 0 or 1.
 For example cubic open uniform B-Spline with d=4 have knot vector {0,0,0,0,1,1,1,1}.
 Open uniform B-Spline curve passes through first and last control points.
 Also slope at each end is parallel to line joining two adjacent control points at that end.
 So geometric condition for matching curve sections are same as for Bezier curves.
 For closed curve we specify first and last control point at the same position.

Non Uniform B-Spline


 For this class of spline we can specify any values and interval for knot vector.
 For example {0,1,2,3,3,4}, and {0,0,1,2,2,3,4}
 It will give more flexible shape of curves. Each blending function have different shape when plots and
different intervals.
 By increasing knot multiplicity we produce variation in curve shape and also introduce discontinuities.

21
Unit-4 – 3D Concept & Object Representation

 Multiple knot value also reduces continuity by 1 for each repeat of particular value.
 We can solve non uniform B-Spline using similar method as we used in uniform B-Spline.
 For set of n+1 control point we set degree d and knot values.
 Then using the recurrence relations we can obtain blending function or evaluate curve position directly
for display of the curve.

B-Spline Surfaces
 B-Spline surface formation is also similar to Bezier splines orthogonal set of curves are used and for
connecting two surface we use same method which is used in Bezier surfaces.
 Vector equation of B-Spline surface is given by cartesion product of B-Spline blending functions:
𝑛1 𝑛2

𝑝(𝑢, 𝑣) = ∑ ∑ 𝑝𝑘1,𝑘2𝐵𝑘1,𝑑1(𝑢)𝐵𝑘2,𝑑2(𝑣)
𝑘1=0 𝑘2=0
 Where 𝑝𝑘1,𝑘2 specify control point position.
 It has same properties as B-Spline curve.

22

You might also like