0% found this document useful (0 votes)
9 views250 pages

Graphics 4

This document discusses three-dimensional geometric transformations, including translation, rotation, and scaling, extending concepts from two dimensions to incorporate the z-coordinate. It details methods for performing these transformations using matrix representations and introduces quaternion methods for efficient 3D rotations. Additionally, it covers composite transformations, reflections, shear, and affine transformations, along with practical problems and applications in three-dimensional viewing.

Uploaded by

Virat D
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)
9 views250 pages

Graphics 4

This document discusses three-dimensional geometric transformations, including translation, rotation, and scaling, extending concepts from two dimensions to incorporate the z-coordinate. It details methods for performing these transformations using matrix representations and introduces quaternion methods for efficient 3D rotations. Additionally, it covers composite transformations, reflections, shear, and affine transformations, along with practical problems and applications in three-dimensional viewing.

Uploaded by

Virat D
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/ 250

Unit III: 3D Object Representations,

Transformations, Viewing &


Clipping
Three-dimensional Geometric
Transformations
 Methods for geometric transformations in three dimensions are extended from
two-dimensional methods by including considerations for the z coordinate.
 When we discussed 2D rotations in the xy plane, we needed to consider only
rotations about axes that were perpendicular to the xy plane.
 In 3D space, we can now select any spatial orientation for the rotation axis.
 Some graphics packages handle 3D rotation as a composite of three rotations,
one for each of the three Cartesian axes
 A three-dimensional position, expressed in homogeneous coordinates, is
represented as a four-element column vector.

 Thus, each geometric transformation operator is now 4x4 matrix, which


premultiplies a coordinate column vector.

 Three-dimensional translation
 Three-dimensional rotation
 Three-dimensional scaling
1. Three-dimensional translation

 A position P = (x, y, z) in three-dimensional space is translated to a


location P = (x, y, z) by adding translation distances tx, ty, and tz to
the Cartesian coordinates of P:

 We can express these three-dimensional translation operations in


matrix form. But now the coordinate positions, P and P , are
represented in homogeneous coordinates with four-element column
matrices, and the translation operator T is a 4 × 4 matrix:
 An object is translated in three dimensions by transforming each of the
defining coordinate positions for the object, then reconstructing the object at
the new location.

 For an object represented as a set of polygon surfaces, we translate each


vertex for each surface as shown in Figure 2 and redisplay the polygon facets
at the translated positions.
2. Three-dimensional rotation

 We can rotate an object about any axis in space, but the easiest rotation axes
to handle are those that are parallel to the Cartesian-coordinate axes.
 Also, we can use combinations of coordinate-axis rotations (along with
appropriate translations) to specify a rotation about any other line in space.
 Therefore, we first consider the operations involved in coordinate-axis
rotations, then we discuss the calculations needed for other rotation axes.
 By convention, positive rotation angles produce counterclockwise rotations
about a coordinate axis, assuming that we are looking in the negative
direction along that coordinate axis.
3D Coordinate-axis rotations
 The two-dimensional z-axis rotation equations are easily extended to three dimensions, as
follows:

 Parameter θ specifies the rotation angle about the z axis, and z-coordinate values are
unchanged by this transformation.
 In homogeneous-coordinate form, the three-dimensional z-axis rotation equations are:
 which we can write more compactly as:

 Transformation equations for rotations about the


other two coordinate axes can be obtained with
a cyclic permutation of the coordinate
parameters x, y, and z in Equations:
 Thus, to obtain the x-axis and y-axis rotation transformations, we cyclically replace x with y, y
with z, and z with x, as illustrated in Figure 5.
 Substituting permutations 7 into Equations 4, we get the equations for an x-axis rotation:
 Rotation of an object around the x axis is
demonstrated in Figure 6.

 A cyclic permutation of coordinates in Equations 8


gives us the transformation equations for a y-axis
rotation:
 An example of y-axis rotation is shown in Figure 7.
 An inverse three-dimensional rotation matrix is
obtained in the same way as the inverse rotations in
two dimensions. We just replace the angle θ with −θ.
 Negative values for rotation angles generate rotations
in a clockwise direction, and the identity matrix is
produced when we multiply any rotation matrix by its
inverse.
 Because only the sine function is affected by the
change in sign of the rotation angle, the inverse
matrix can also be obtained by interchanging rows
and columns.
 That is, we can calculate the inverse of any rotation
matrix R by forming its transpose (R−1 = RT ).
General Three-dimensional rotations:
 A rotation matrix for any axis that does not coincide with a coordinate axis can be set up as a
composite transformation involving combinations of translations and the coordinate-axis
rotations.
 We first move the designated rotation axis onto one of the coordinate axes.
 Then we apply the appropriate rotation matrix for that coordinate axis.
 The last step in the transformation sequence is to return the rotation axis to its original
position.
 In the special case where an object is to be rotated about an axis that is parallel to one of the
coordinate axes, we attain the desired rotation with the following transformation sequence:
1. Translate the object so that the rotation axis coincides with the parallel coordinate axis.
2. Perform the specified rotation about that axis.
3. Translate the object so that the rotation axis is moved back to its original position.
 The steps in this sequence are illustrated in Figure 8. A coordinate position P is transformed with
the sequence shown in this figure as:

 Where the composite rotation matrix for the transformation is:

 This composite matrix is of the same form as the two-dimensional transformation sequence for
rotation about an axis that is parallel to the z axis (a pivot point that is not at the coordinate
origin).
 When an object is to be rotated about an axis that is not parallel to one of the coordinate axes,
we must perform some additional transformations.
 In this case, we also need rotations to align the rotation axis with a selected coordinate axis and
then to bring the rotation axis back to its original orientation.
 Given the specifications for the rotation axis and the rotation angle, we can accomplish the
required rotation in five steps:
1. Translate the object so that the rotation axis passes through the coordinate origin.
2. Rotate the object so that the axis of rotation coincides with one of the coordinate axes.
3. Perform the specified rotation about the selected coordinate axis.
4. Apply inverse rotations to bring the rotation axis back to its original orientation.
5. Apply the inverse translation to bring the rotation axis back to its original spatial position.
• We can transform the rotation axis onto any one of the three
coordinate axes.
• The z axis is often a convenient choice, and we next consider a
transformation sequence using the z-axis rotation matrix.
• A rotation axis can be defined with two coordinate positions, or
with one coordinate point and direction angles (or direction
cosines) between the rotation axis and two of the coordinate axes.
• We assume that the rotation axis is defined by two points, and that
the direction of rotation is to be counterclockwise when looking
along the axis from P2 to P1.
• The components of the rotation-axis vector are then computed as:
 where the components a, b, and c are the direction cosines for
the rotation axis:

 The first step in the rotation sequence is to set up the


translation matrix that repositions the rotation axis so that it
passes through the coordinate origin.
 Because we want a counterclockwise rotation when viewing
along the axis from P2 to P1 (Figure 10), we move the point P1
to the origin.
 Next, we formulate the transformations that will
put the rotation axis onto the z axis.
 We can use the coordinate-axis rotations to
accomplish this alignment in two steps, and there
are a number of ways to perform these two steps.
 For this example, we first rotate about the x axis,
then rotate about the y axis.
 The x-axis rotation gets vector u into the xz plane,
and the y-axis rotation swings u around to the z
axis.
 We establish the transformation matrix for rotation around the
x axis by determining the values for the sine and cosine of the
rotation angle necessary to get u into the xz plane.
 This rotation angle is the angle between the projection of u in
the yz plane and the positive z axis (Figure 13).
 If we represent the projection of u in the yz plane as the
vector u = (0, b, c), then the cosine of the rotation angle α can
be determined from the dot product of u and the unit vector uz
along the z axis:
 Where d is the magnitude of u’:
 Similarly, we can determine the sine of α from the cross-product of u and uz. The coordinate-
independent form of this cross-product is :


 Now that we have determined the values for cosα and sin α in
terms of the components of vector u, we can set up the matrix
elements for rotation of this vector about the x axis and into
the xz plane:

 The next step in the formulation of the transformation


sequence is to determine the matrix that will swing the unit
vector in the xz plane counterclockwise around the y axis onto
the positive z axis.
Quaternion Methods for 3D Rotations

 Quaternions, which are extensions of two-dimensional complex numbers, are useful in a number
of computer-graphics procedures, including the generation of fractal objects.
 They require less storage space than 4 × 4 matrices, and it is simpler to write quaternion
procedures for transformation sequences.
 This is particularly important in animations, which often require complicated motion sequences
and motion interpolations between two given positions of an object.
 One way to characterize a quaternion is as an ordered pair, consisting of a
scalar part and a vector part:

 A rotation about any axis passing through the coordinate origin is
accomplished by first setting up a unit quaternion with the
scalar and vector parts as follows:

where u is a unit vector along the selected rotation axis and θ is


the specified rotation angle about this axis (Figure 16).
 Any point position P that is to be rotated by this quaternion can
be represented in quaternion notation as :
 To complete the transformation sequence for rotating about an arbitrarily placed rotation axis,
we need to include the translations that move the rotation axis to the coordinate axis and
return it to its original position.
 Thus, the complete quaternion rotation expression, corresponding to Equation 28, is:

 For example, we can perform a rotation about the z axis by setting rotation axis vector u to the
unit z-axis vector (0, 0, 1). Substituting the components of this vector into Matrix 39, we get the
3×3 version of the z-axis rotation matrix Rz(θ).
3. Three-dimensional scaling

 The matrix expression for the three-dimensional scaling transformation of a


position P = (x, y, z) relative to the coordinate origin is a simple extension of
two-dimensional scaling.
 We just include the parameter for z-coordinate scaling in the transformation
matrix:

 The three-dimensional scaling transformation for a point position can be


represented as:
 where scaling parameters sx , sy, and sz are assigned any positive values.
 Explicit expressions for the scaling transformation relative to the origin are:

 A parameter value greater than 1 moves a point farther from the origin in the corresponding
coordinate direction.
 Similarly, a parameter value less than 1 moves a point closer to the origin in that coordinate
direction.
 Also, if the scaling parameters are not all equal, relative dimensions of a transformed object are
changed.
 We preserve the original shape of an object with a uniform scaling: sx = sy = sz.
 Because some graphics packages provide only a routine that scales relative to the coordinate
origin, we can always construct a scaling transformation with respect to any selected fixed
position (xf , yf , zf) using the following transformation sequence:
1. Translate the fixed point to the origin.
2. Apply the scaling transformation relative to the coordinate origin using Equation for z-
coordinate scaling in the transformation matrix.
3. Translate the fixed point back to its original position.
 The matrix representation for an arbitrary fixed-point scaling can then be expressed as the
concatenation of these translate-scale-translate transformations:

 We can set up programming procedures for constructing a three-dimensional scaling matrix using
either a translate-scale-translate sequence or a direct incorporation of the fixed-point
coordinates.
Composite 3D Transformations:

 As with two-dimensional transformations, we form a composite three dimensional


transformation by multiplying the matrix representations for the individual operations in the
transformation sequence.

 Any of the two-dimensional transformation sequences, such as scaling in non-coordinate


directions, can be carried out in three-dimensional space.

 We can implement a transformation sequence by concatenating the individual matrices from


right to left or from left to right, depending on the order in which the matrix representations
are specified.
Other Three-dimensional
Transformations
 In addition to translation, rotation, and scaling, the other transformations
discussed for two-dimensional applications are also useful in many three-
dimensional situations. These additional transformations include reflection,
shear, and transformations between coordinate-reference frames.

 Three-dimensional Reflections

 Three-dimensional Shear
Three-dimensional Reflections

 A reflection in a three-dimensional space can be performed relative to a


selected reflection axis or with respect to a reflection plane. In general,
three-dimensional reflection matrices are set up similarly to those for two
dimensions.
 Reflections relative to a given axis are equivalent to 180◦ rotations about that
axis.
 Reflections with respect to a plane are similar; when the reflection plane is a
coordinate plane (xy, xz, or yz), we can think of the transformation as a 180◦
rotation in four-dimensional space with a conversion between a left-handed
frame and a right-handed frame.
 The matrix representation for this reflection relative to the xy plane is:
Three-dimensional Shear

 These transformations can be used to modify object shapes, just as in two-


dimensional applications. They are also applied in three-dimensional viewing
transformations for perspective projections.
 A general z-axis shearing transformation relative to a selected reference
position is produced with the following matrix:
 Shearing parameters shzx and shzy can be assigned any real
values.

 The effect of this transformation matrix is to alter the values


for the x and y coordinates by an amount that is proportional to
the distance from zref, while leaving the z coordinate
unchanged.

 Plane areas that are perpendicular to the z axis are thus shifted
by an amount equal to z-zref.
Affine Transformations

 A coordinate transformation of the form:

 Each of the transformed coordinates x, y, and z is a linear function of the original coordinates x,
y, and z, and parameters ai j and bk are constants determined by the transformation type.
 Affine transformations (in two dimensions, three dimensions, or higher dimensions) have the
general properties that parallel lines are transformed into parallel lines, and finite points map
to finite points.
Problems

 A triangle is defined by 3 vertices A (0, 2, 1), B (2, 3, 0), C (1, 2, 1). Find the
final co-ordinates after it is rotated by 45 degree around a line joining the
points (1, 1, 1) and (0, 0, 0).

 A cube is defined by 8 vertices A (0,0,0), B (2,0,0), C (2,2,0), D (0,2,0), E


(0,0,2), F (2,0,2), G (2,2,2), and H (0,2,2). Find the final coordinates after it
is rotated by 45 degree around a line joining the points (2,0,0), and (0,2,2).
Three-dimensional Viewing

 For two-dimensional graphics applications, viewing operations transfer


positions from the world-coordinate plane to pixel positions in the plane of
the output device.
 Using the rectangular boundaries for the clipping window and the viewport, a
two-dimensional package clips a scene and maps it to device coordinates.
 Three-dimensional viewing operations, however, are more involved, because
we now have many more choices as to how we can construct a scene and how
we can generate views of the scene on an output device.
I. Viewing a Three-dimensional Scene

 To obtain a display of a three-dimensional world-coordinate scene, we first set up a coordinate


reference for the viewing, or “camera,” parameters.
 This coordinate reference defines the position and orientation for a view plane (or projection
plane) that corresponds to a camera film plane.
 Object descriptions are then transferred to the viewing reference coordinates and projected
onto the view plane.
 We can generate a view of an object on the output device in wireframe (outline) form, or we
can apply lighting and surface-rendering techniques to obtain a realistic shading of the visible
surfaces.
II. Projections

 Unlike a camera picture, we can choose different methods for projecting a scene onto the view
plane.
 One method for getting the description of a solid object onto a view plane is to project points
on the object surface along parallel lines.
 This technique, called parallel projection, is used in engineering and architectural drawings to
represent an object with a set of views that show accurate dimensions of the object.
 Another method for generating a view of a three-dimensional scene is to project points to the
view plane along converging paths.
 This process, called a perspective projection, causes objects farther from the viewing position
to be displayed smaller than objects of the same size that are nearer to the viewing position.
 A scene that is generated using a perspective projection appears more realistic, because this is
the way that our eyes and a camera lens form images.
 Parallel lines along the viewing direction appear to converge to a distant point in the
background, and objects in the background appear to be smaller than objects in the foreground.
III. Depth Cueing

 With few exceptions, depth information is important in a three-dimensional scene so that we


can easily identify, for a particular viewing direction, which is the front and which is the back of
each displayed object.
 A simple method for indicating depth with wire-frame displays is to vary
the brightness of line segments according to their distances from the viewing position.
 The lines closest to the viewing position are displayed with the highest intensity, and lines
farther away are displayed with decreasing intensities.
 Depth cueing is applied by choosing a maximum and a minimum intensity value and a range of
distances over which the intensity is to vary.
 Another application of depth cuing is modeling the effect of the atmosphere on the perceived
intensity of objects.

 More distant objects appear dimmer to us than nearer objects due to light scattering by dust
particles, haze, and smoke.

 Some atmospheric effects can even change the perceived color of an object, and we can model
these effects with depth cueing.
IV. Identifying Visible Lines and
Surfaces
 We can also clarify depth relationships in a wire-frame display using
techniques other than depth cueing.
 One approach is simply to highlight the visible lines or to display them in a
different color.
 Another technique, commonly used for engineering drawings, is to display the
non-visible lines as dashed lines.
 Or we could remove the non-visible lines from the display.
 But removing the hidden lines also removes information about the shape of the back surfaces of
an object, and wire-frame representations are generally used to get an indication of an object’s
overall appearance, front and back.
 A wire-frame object displayed with depth cueing, so that the brightness of lines decreases from
the front of the object to the back.
 When a realistic view of a scene is to be produced, back parts of the objects are completely
eliminated so that only the visible surfaces are displayed.
 In this case, surface-rendering procedures are applied so that screen pixels contain only the
color patterns for the front surfaces.
V. Surface Rendering

 Added realism is attained in displays by rendering object surfaces using the


lighting conditions in the scene and the assigned surface characteristics.
 We set the lighting conditions by specifying the color and location of the light
sources, and we can also set background illumination effects.
 Surface properties of objects include whether a surface is transparent or
opaque and whether the surface is smooth or rough.
 We set values for parameters to model surfaces such as glass, plastic, wood-
grain patterns, and the bumpy appearance of an orange.
VI. Exploded and Cutaway Views

 Many graphics packages allow objects to be defined as hierarchical structures, so that internal
details can be stored.

 Exploded and cutaway views of such objects can then be used to show the internal structure and
relationship of the object parts.

 An alternative to exploding an object into its component parts is a cutaway view, which removes
part of the visible surfaces to show internal structure.
VII. Three-dimensional and
Stereoscopic Viewing
 Three-dimensional views can be obtained by reflecting a raster image from a
vibrating, flexible mirror.
 The vibrations of the mirror are synchronized with the display of the scene on
the cathode ray tube (CRT).
 As the mirror vibrates, the focal length varies so that each point in the scene
is reflected to a spatial position corresponding to its depth.
 Stereoscopic devices present two views of a scene: one for the left eye and
the other for the right eye.
 The viewing positions correspond to the eye positions of the viewer.
 These two views are typically displayed on alternate refresh cycles of a raster
monitor.
The Three-dimensional Viewing
Pipeline
 First of all, we need to choose a viewing position corresponding to where we
would place a camera.
 We choose the viewing position according to whether we want to display a front,
back, side, top, or bottom view of the scene.
 We could also pick a position in the middle of a group of objects or even inside a
single object, such as a building or a molecule.
 Which way do we want to point the camera from the viewing position, and how
should we rotate it around the line of sight to set the “up” direction for the
picture?
 Some of the viewing operations for a three-dimensional scene are the same as, or
similar to, those used in the two-dimensional viewing pipeline.
 A two-dimensional viewport is used to position a projected view of the three-
dimensional scene on the output device, and a two-dimensional clipping window is
used to select a view that is to be mapped to the viewport.
Three-dimensional Viewing Pipeline

World coordinates(3D)

transform Transform into view coordinates


and Canonical view volume
View coordinates(3D)

clip Clip against canonical view


volume
View coordinates(3D)

Project on to view plane

View coordinates(3D)

transform Map into viewport

Normalized device coordinates


Transform to physical
Device coordinates

Physical device coordinates (2D)


 Clipping windows, viewports, and display windows are usually specified as rectangles with their
edges parallel to the coordinate axes.
 In three-dimensional viewing, however, the clipping window is positioned on a selected view
plane, and scenes are clipped against an enclosing volume of space, which is defined by a set of
clipping planes.
 The viewing position, view plane, clipping window, and clipping planes are all specified within
the viewing-coordinate reference frame.
 A two-dimensional clipping window, corresponding to a selected camera
lens, is defined on the projection plane, and a three-dimensional clipping region is established.
 This clipping region is called the view volume, and its shape and size depends on the dimensions
of the clipping window, the type of projection
we choose, and the selected limiting positions along the viewing direction.
 Projection operations are performed to convert the viewing-coordinate description of the scene
to coordinate positions on the projection plane.
 Objects are mapped to normalized coordinates, and all parts of the scene outside the view
volume are clipped off.
 The clipping operations can be applied after all device-independent coordinate transformations
(from world coordinates to normalized coordinates) are completed.
 In this way, the coordinate transformations can be concatenated
for maximum efficiency.
 Scene descriptions in device coordinates are sometimes expressed in a left-handed reference
frame so that positive distances from the display screen can be used to measure depth values in
the scene.
Three-dimensional Viewing-
Coordinate Parameters
 Establishing a three-dimensional viewing reference frame is similar to setting
up the two-dimensional viewing reference frame.

 We first select a world-coordinate position P0 =(x0, y0, z0) for the viewing
origin, which is called the view point or viewing position. (Sometimes the
view point is also referred to as the eye position or the camera position.)

 And we specify a view-up vector V, which defines the yview direction.

 For three-dimensional space, we also need to assign a direction for one of the
remaining two coordinate axes.
A. The View-Plane Normal Vector

 Because the viewing direction is usually along the zview axis, the view plane, also called the
projection plane, is normally assumed to be perpendicular to this axis.

 Thus, the orientation of the view plane, as well as the direction for the positive zview axis, can
be defined with a view-plane normal vector N.

 An additional scalar parameter is used to set the position of the view plane at some coordinate
value zvp along the zview axis.
 This parameter value is usually specified as a distance from the viewing origin along the
direction of viewing, which is often taken to be in the negative zview direction.
 Thus, the view plane is always parallel to the xview, yview plane, and the projection of objects
to the view plane corresponds to the view of the scene that will be displayed on the output
device.
 Vector N can be specified in various ways. In some graphics systems, the
direction for N is defined to be along the line from the world-coordinate origin to a selected
point position.
 Other systems take N to be in the direction from a reference point Pref to the viewing origin P0,
as in Figure 10. In this case, the reference point is often referred to as a look-at point within
the scene, with the viewing direction opposite to the direction of N.
 We could also define the view-plane normal vector, and other vector directions, using direction
angles.
 These are the three angles,α,β, andγ, that a spatial line makes with the x, y, and z axes,
respectively. But it is usually much easier to specify a vector direction with two point positions
in a scene than with direction angles.
B. The View-up Vector

 Once we have chosen a view-plane normal vector N, we can set the


direction for the view-up vector V. This vector is used to establish the
positive direction for the yview axis.
 Usually, V is defined by selecting a position relative to the world-
coordinate origin, so that the direction for the view-up vector is from
the world origin to this
selected position.
 Because the view-plane normal vector N defines the direction for the
zview axis, vector V should be perpendicular to N.
 But, in general, it can be difficult to determine a direction for V that is precisely perpendicular
to N.

 Therefore, viewing routines typically adjust the user-defined orientation of vector V, as shown
in Figure 11, so that V is projected onto a plane that is perpendicular to the view-plane normal
vector.

 We can choose any direction for the view-up vector V, so long as it is not parallel to N.

 A convenient choice is often in a direction parallel to the world yw axis; that is, we could set V =
(0, 1, 0).
C. The uvn Viewing-Coordinate
Reference Frame
 Left-handed viewing coordinates are sometimes used in graphics packages,
with the viewing direction in the positive zview direction.
 With a left-handed system, increasing zview values are interpreted as being
farther from the viewing position along the line of sight.
 But right-handed viewing systems are more common, because they have the
same orientation as the world-reference frame.
 This allows a graphics package to deal with only one coordinate orientation
for both world and viewing references.
 Because the view-plane normal N defines the direction for the zview axis and
the view-up vector V is used to obtain the direction for the yview axis, we
need only determine the direction for the xview axis.
 We determine the correct direction for U by taking the vector
cross product of V and N so as to form a right-handed viewing
frame.
 The vector cross product of N and U also produces the
adjusted value for V, perpendicular to both N and U, along
the positive yview axis. Following these procedures, we
obtain the following set of unit axis vectors for a right-
handed viewing coordinate system.
D. Generating Three-dimensional
Viewing Effects
 For instance, from a fixed viewing position, we could change the direction of N to display
objects at positions around the viewing-coordinate origin.
 We could also vary N to create a composite display consisting of multiple views from a fixed
camera position.
 We can simulate a wide viewing angle by producing seven views of the scene from the same
viewing position, but with slight shifts in the viewing direction; the views are then combined to
form a composite display.
 Similarly, we generate stereoscopic views by shifting the viewing direction as well as shifting the
view point slightly to simulate the two eye positions.
 If we want to simulate an animation panning effect, as
when a camera moves
through a scene or follows an object that is moving
through a scene, we can keep the direction for N fixed
as we move the view point, as illustrated in Figure 13.

 And to display different views of an object, such as a


side view and a front view, we could move the view
point around the object, as in Figure 14.
Transformation from World to Viewing
Coordinates
 In the three-dimensional viewing pipeline, the first step after a scene has been constructed is to
transfer object descriptions to the viewing-coordinate reference frame.
 This conversion of object descriptions is equivalent to a sequence of transformations that
superimposes the viewing reference frame onto the world frame.
 We can accomplish this conversion using the methods for transforming between coordinate
system :
1. Translate the viewing-coordinate origin to the origin of the world-coordinate system.
2. Apply rotations to align the xview, yview, and zview axes with the world xw, yw, and zw axes,
respectively.
Projection Transformations

 In the next phase of the three-dimensional viewing pipeline, after the transformation to viewing
coordinates, object descriptions are projected to the view plane.
 Graphics packages generally support both parallel and perspective projections.
 In a parallel projection, coordinate positions are transferred to the view plane along parallel
lines.
 A parallel projection preserves relative proportions of objects, and this is the method used in
computer-aided drafting and design to produce scale drawings of three-dimensional objects.
 All parallel lines in a scene are displayed as parallel when viewed with a parallel projection.
 There are two general methods for obtaining a parallel-projection view of an object: We can
project along lines that are perpendicular to the view plane, or we can project at an oblique
angle to the view plane.

 For a perspective projection, object positions are transformed to projection coordinates along
lines that converge to a point behind the view plane.

 Unlike a parallel projection, a perspective projection does not preserve relative proportions of
objects.

 But perspective views of a scene are more realistic because distant objects in the projected
display are reduced in size.
1. Parallel Projections

 Parallel Projection use to display picture in its true shape and size. When
projectors are perpendicular to view plane then is called orthographic
projection.
 The parallel projection is formed by extending parallel lines from each vertex
on the object until they intersect the plane of the screen.
 The point of intersection is the projection of vertex.
 Parallel projections are used by architects and engineers for creating working
drawing of the object, for complete representations require two or more
views of an object using different planes.
1.1. Orthogonal Projections

 A transformation of object descriptions to a view plane along lines that are all
parallel to the view-plane normal vector N is called an orthogonal projection (or,
equivalently, an orthographic projection).

 This produces a parallel-projection transformation in which the projection lines


are perpendicular to the view plane.

 Orthogonal projections are most often used to produce the front, side, and top
views of an object.

 Elevations and plan view: Front, side, and rear orthogonal projections of an
object are called elevations; and a top orthogonal projection is called a plan view.
❖ Mostly used by drafters and engineers to create working drawings of an object
which preserves its scale and shape.

❖ The distance between the COP and the projection plane is infinite i.e. The
projectors are parallel to each other and have a fixed direction.
Normalization Transformation for an
Orthogonal Projection

 Using an orthogonal transfer of coordinate positions onto the view plane, we


obtain the projected position of any spatial point (x, y, z) as simply (x, y).
 Thus, once we have established the limits for the view volume, coordinate
descriptions inside this rectangular parallelepiped are the projection
coordinates, and they can be mapped into a normalized view volume
without any further projection processing.
 Some graphics packages use a unit cube for this normalized view volume, with
each of the x, y, and z coordinates normalized in the range from 0
to 1.
 Another normalization-transformation approach is to use a symmetric cube,
with coordinates in the range from -1 to 1.
 To illustrate the normalization transformation, we assume that the
orthogonal-projection view volume is to be mapped into the symmetric normalization cube
within a left-handed reference frame.
 Also, z-coordinate positions for the near and far planes are denoted as znear and zfar,
respectively. Figure 24 illustrates this normalization transformation. Position (xmin, ymin, znear)
is mapped to the normalized position (-1, -1, -1), and position (xmax, ymax, zfar)
is mapped to (1, 1, 1).
 The normalization transformation for the orthogonal view volume is:
1.2. Oblique projection

 An oblique projection is obtained by projecting points along parallel lines that


are not perpendicular to the projection plane.
 The view plane normal and the direction of projection are not the same.
 The oblique projections are further classified as the cavalier and cabinet
projections.
 For the cavalier projections, the direction of projection makes a 45 degree
angle with the view plane.
 The projection of a line perpendicular to the view plane has the same length
as the line itself; that is, there is no foreshortening.
Normalization Transformation for an
Oblique Parallel Projection

 Because the oblique parallel-projection equations convert object descriptions


to orthogonal-coordinate positions, we can apply the normalization
procedures following this transformation.
 The oblique view volume has been converted to a rectangular parallelepiped.
2. Perspective Projections

 In perspective projection farther away object from the viewer, small it


appears. This property of projection gives an idea about depth. The artist use
perspective projection from drawing three-dimensional scenes.

 Two main characteristics of perspective are vanishing points and perspective


foreshortening. Due to foreshortening object and lengths appear smaller
from the center of projection. More we increase the distance from the center
of projection, smaller will be the object appear.
Perspective-Projection Transformation
Coordinates
 We can sometimes select the projection reference point as another viewing parameter in a
graphics package, but some systems place this convergence point at a fixed position, such as at
the view point.
 Figure 34 shows the projection path of a spatial position (x, y, z) to a general projection
reference point at (xpr p, ypr p, zpr p).
 The projection line intersects the view plane at the coordinate position (xp, yp, zvp), where zvp
is some selected position for the view plane on the zview axis.
 We can write equations describing coordinate positions along this
perspective-projection line in parametric form as :
Perspective-Projection Equations: Special
Cases
Important terms in Perspective
Projections
 View plane: It is an area of world coordinate system which is projected into
viewing plane.

 Center of Projection: It is the location of the eye on which projected light


rays converge.

 Projectors: It is also called a projection vector. These are rays start from the
object scene and are used to create an image of the object on viewing or
view plane.
It introduces several anomalies due to these object shape and appearance gets
affected.
 Perspective foreshortening: The size of the object will be small of its
distance from the center of projection increases.
 Vanishing Point: All lines appear to meet at some point in the view plane.
 Distortion of Lines: A range lies in front of the viewer to back of viewer is
appearing to six rollers.
1. Perspective Projections: Vanishing
points
 The point at which a set of projected parallel lines appears to converge is
called a vanishing point.
 It is the point where all lines will appear to meet. There can be one point,
two point, and three point perspectives.
 There is an illusion that certain sets of parallel lines (that are not parallel to
the view plane ) appear to meet at some point on the view plane.
 The vanishing point for any set of parallel lines that are parallel to one of
principal axis is referred to as a principal vanishing point (PVP).
 The number of PVPs is determined by the number of principal axes
intersected by the view plane.
One principal vanishing point projection

- occurs when the projection plane is perpendicular to one of the principal axes (x, y or z ).

Vanishing point

View plane is parallel to


XY-plane and intersects
Z-axis only.
Two principal vanishing point projection

View plane intersects


Both X and Z axis but
not the Y axis

X-axis
Vanishing point Z-axis
Vanishing point
 Three principal vanishing point intersection

VP2

VP1

View plane intersects all


Three of the principal axis
X, Y and Z axis

VP3
Normalized Perspective-Projection
Transformation Coordinates
View Volume

- The view volume bounds that portion of the 3D space that is to be clipped out
and projected onto the view plane.
View Volume for Perspective Projection

- its shape is semi-infinite pyramid with apex at the view point and edge
passing through the corners of the window.

Frustum view volume

cop
View Front clipping Back clipping
window plane plane
View Volume for Parallel Projection

Parallelepiped
Viewed volume

Back clipping
plane
-It's shape is an infinite parallelepiped with sides parallel to the direction of projection.
Front clipping
plane
View
window
Producing a Canonical view volume for a perspective projection

cop
View volume

View
window

Front View frustum


General shape clip centerline
for the Perspective
View volume Back clip
Step 1: shear the view volume so that centerline of the frustum is perpendicular to the view
plane and passes through the center of the view window.

Frustum centerline

View volume
Step2: scale view volume inversely proportional to the distance from the view window, so that
shape of view volume becomes rectangular parallelepiped.

View volume
Converting object coordinates to view plane coordinates

❖ similar to the process of rotation about an arbitrary axis

zw
VRP

xw Yw Yv
Xv
World coordinate system View plane (eye)
coordinate system
Steps:

1. Translate origin to view reference point (VRP).

2. Translate along the view plane normal by view distance.

3. Align object coordinate’s z-axis with view plane coordinates z-axis (the view plane
normal).

a)- Rotate about x-axis to place the line (ie. Object coordinates z-axis) in the view
plane coordinates xz-plane.

b)- Rotate about y-axis to move the z axis to its proper position.

c)- Rotate about the z-axis until x and y axis are in place in the view plane
coordinates.
Three-Dimensional Clipping Algorithms

 All device-independent transformations (geometric and viewing) are concatenated and applied
before executing the clipping routines.
 And each of the clipping boundaries for the normalized view volume is a plane that is parallel to
one of the Cartesian planes, regardless of the projection type and original shape of the view
volume.
 Depending on whether the view volume has been normalized to a unit cube or to a symmetric
cube with edge length 2, the clipping planes have coordinate positions either at 0 and 1 or at -1
and 1.
 For the symmetric cube, the equations for the three-dimensional clipping planes are:
Clipping in 3D Homogeneous
Coordinates
 Computer-graphics libraries process spatial positions as four-dimensional homogeneous
coordinates so that all transformations can be represented as 4 by 4 matrices.
 As each coordinate position enters the viewing pipeline, it is converted to a four-dimensional
representation:
Three-dimensional Region Codes
3D Point and Line Clipping
3D Polygon Clipping
THREE-DIMENSIONAL (3D) OBJECT
REPRESENTATION
General Modeling Techniques

• Polygon Mesh Models


• Curved Surfaces
• Quadric Surfaces
• Constructive Solid-Geometry
• BSP Trees
• Octrees
• Fractals
OTHER MODELING TECHNIQUES

o Particle Systems
(for modeling objects that exhibit ‘fluid-like’ properties
e.g. – smoke, fire, waterfalls etc)

o Volume Rendering
(to show interior information of a data set e.g.- Seismic
data or data set from a CT scanner)

o Physically-based Modeling
(for modeling nonrigid objects and its behavior in terms
of the interaction of external and internal forces e.g.- a
rope, a piece of cloth or a soft rubber ball)
POLYGAN MESH MODELS

 Most commonly used method for polyhedron objects

 Object description is stored as sets of surface polygons

 Speeds up the surface rendering and display of objects

 Preview of scene in wireframe representation


Fig.- Hierarchical Structure for Polygon Mesh Models
Fig. – Geometric Data Tables
POLYGON MESHES
o USEFUL TO INCREASE THE SPEED OF POLYGON RENDERING
o ALSO HELPS TO DECREASE THE SIZE OF THE DATABASE
Contd…
Quadrilateral Mesh

 For n by n array of vertices, a mesh of (n-1)by (m-1) quadrilaterals is generated.


 All 4 vertices of a quadrilateral may not lie in one plane due to numerical errors or
error in selecting coordinate positions for the vertices.
Curved Surfaces

 Equations for objects with curved boundaries can be expressed in either a


parametric or a nonparametric form.

 The various objects that are often useful in graphics applications include
quadric surfaces, superquadrics, polynomial and exponential functions, and
spline surfaces.

 These input object descriptions typically are tessellated to produce polygon-


mesh approximations for the surfaces.
Quadric Surfaces

 A frequently used class of objects are the quadric surfaces, which are described with second-
degree equations (quadratics).

 They include spheres, ellipsoids, tori, paraboloids, and hyperboloids. Quadric surfaces,
particularly spheres and ellipsoids, are common elements of graphics scenes, and routines for
generating these
surfaces are often available in graphics packages.

 Also, quadric surfaces can be produced with rational spline representations.


Quadric Surfaces: Sphere
Quadric Surfaces: Ellipsoid

 An ellipsoidal surface can be described as an extension of a


spherical surface where the radii in three mutually perpendicular
directions can have different values (Figure 4). The Cartesian
representation for points over the surface of an ellipsoid centered
on the origin is:
Quadric Surfaces: Torus
Superquadrics

 The class of objects called Superquadrics is a generalization of the quadric


representations. Superquadrics are formed by incorporating additional
parameters into the quadric equations to provide increased flexibility for
adjusting object shapes.

 One additional parameter is added to curve equations, and two additional


parameters are used in surface equations.
Superquadrics: Superellipse
Superquadrics: Superellipsoid
Curves and Surfaces

Bézier Curves & Surfaces


Representation of Curves

Brute Force Approach


 A curve can be approximated by a finite number of short straight line segments.
 To get a better approximation we can use more segments per unit length.
 This increases the amount of data required to store the curve and makes it difficult to
manipulate.
 We clearly need a way of representing these curves in a more mathematical fashion.
Some Desirable Properties

 Reproducible - the representation should give the same curve every time;
 Computationally Quick;
 Easy to manipulate, especially important for design purposes;
 Flexible;
 Easy to combine with other segments of curve.
Categories of Curves

 Interpolating Curves
- These curves will pass through the points used to describe it.
- The points through which the curve passes are known as knots.

 Approximation Curves
- An approximating curve will get near to the points without necessarily passing through any of
them.
Interpolation
Approximation
Curve Representation

Non-parametric Representation

 Implicit Representation of a circle


x2 + y2 – r2 = 0

 Explicit Representation of a circle


y = + [(r2 – x2)] for the upper half
y = - [(r2 – x2)] for the lower half
Explicit vs. Implicit Rep. : Problems

 The Explicit form is satisfactory when the function is single-valued and the curve has no
vertical tangents.
 The implicitly defined curves require the solution of a non-linear equation for each point and
thus numerical procedures have to be employed.
 Both explicitly and implicitly represented curves are axis-dependent.
Parametric Representation of Curves

 The parametric form uses an auxiliary parameter to represent the position of


a point.
 For example, a circle with center at origin may be represented by an angle
parameter u  [0,2]:
x(u) = r.cos(u), y(u) = r.sin(u)
Advantages of Parametric Representation
 Since a point on a parametric curve is specified by a
single value of parameter, the use of parametric
techniques free us from dependence on any particular
system of coordinates.
 It avoids problems which can arise in representing closed
or multiple-valued curves and curves with vertical
tangents in a fixed coordinate system.
 The parametric methods lends itself to the piecewise
description of curves and surfaces, which is the basic
technique for the description of free-form shapes.
Bases and Control Points

 Most methods used in Computer Graphics depend upon


polynomial representations. A polynomial of degree k in t can
be written in terms of k+1 coefficients as
C(t) = c0 + c1t + c2t2 …cktk ----- (1)

 The representation above for a polynomial is not ideal. Its


shape depends upon the values given to the coefficients ci
and it is not easy to predict the effect i.e. the effect of
change in these coefficients on the shape of the curve.
Primitive Polynomial Basis

 In three-dimensional Euclidean space an arbitrary vector is described as a linear combination


of three independent vectors.
 These vectors form a basis for the space and allow the definition of any vector in terms of the
basis.
 The most obvious independent functions to use as a basis for a k-dimensional polynomial space
are:
bi(t) = ti 0ik
Representing Polynomials in
terms of Basis Functions

 Using equation (1), a quadratic curve could be defined by:

• By changing coefficients (points in 2D space), we can


change the shape of the curve. Hence they are
known as control points pi.
Contd…

 Therefore the general equation of a curve in terms of basis functions bi(t) and control points pi
is as follows:

• when k=3, a cubic curve and its control points might


appear as follows:
Contd…

 Various Sets of Basis functions have been used in Computer Graphics for the specification of
curves.
 Among these are the Bézier Basis and B-Spline Basis.
Advantages of Cubic Curves

1. A cubic curve is the lowest order curve which offers


enough shape flexibility, i.e. it is the lowest order
curve with a point of inflexion (a point on a curve at which
that curvature changes from convex to concave or vice versa).
2. Higher order curves when fitted to data points can
exhibit oscillations between the data points and take
more time to evaluate.
3. Cubic segments can be fitted together with second
degree continuity, this allows smooth joins between
segments.
Parametric Continuity Conditions

 To ensure a smooth transition from one section of a piecewise parametric curve to the next, we can
impose various continuity conditions at the connection points.
 Suppose each section of a connected curve is described with following parametric equations:
x=x(u), y=y(u), z=z(u), u1u u2
 We set the parametric continuity by matching the parametric derivatives of adjoining curve sections
at their common boundary.
Contd…

Zero Order C0 Continuity


✓ Last point of first section is same as first point of the second section.
First Order C1 Continuity
✓ Tangents of the two sections are the same at their joining point.
Second Order C2 Continuity
✓ Both the first & second parametric derivatives of the two curve
sections are the same at the join.
Geometric Continuity Conditions

 Another method for joining two successive curve sections is to specify conditions
for geometric continuity.
 In this case, we require only that the parametric derivatives of the two sections
are proportional to each other at their common boundary, instead of requiring
equality.
 Zero-order geometric continuity, described as G0 continuity, is the same as zero-
order parametric continuity. That is, two successive curve sections must have the
same coordinate position at the boundary point.
 First-order geometric continuity, or G1 continuity, means that the parametric
first derivatives are proportional at the intersection of two successive sections.
 Second-order geometric continuity, or G2 continuity, means that both the first
and second parametric derivatives of the two curve sections are proportional at
their boundary. Under G2 continuity, curvatures of two curve sections will match
at the joining position.
Bézier Curves

 Bézier functions are a set of polynomials which can be used


instead of the primitive polynomial basis and have some
useful properties for interactive curve design.
 The cubic Bézier Curve with the four control points P0, P1, P2
and P3 is illustrated below:
Examples: 2-D Bezier Curves

Control Polygon

Bezier Curve
Contd…

 The cubic Bézier curve is defined in the range [0,1] in t by:

• The cubic Bézier (blending) functions are then:

• These are sometimes called the Bernstein


polynomials of order three.
Contd…

 Expanding Bernstein polynomials in terms of the primitive polynomial basis functions of


degree three the curve definition can be written in the form:

• where Mb and Gb are the Bézier Geometric Basis


Matrix and Geometric Vector respectively.
Contd…

 It is easy to generalize the above to curves of degree n with n+1 control points. Thus:

where the Bézier Blending Functions bn,i(t) are


defined by:

• In practice it is better to use piecewise connected


Bézier cubics rather than higher order Bézier curves.
Piecewise Cubic Bézier Curves

 Multiple curve pieces can be joined together to form longer


continuous curves.
 The curve is made continuous by setting the tangents the
same at the join (C1 continuity).

0 0 1
0.5 0 1
1 0 0.5
1 0 0

1 0 0
1 0 -0.5
2 0 0
2 0 0.5
Construction of Bezier Curve
Recursive Subdivision approach (De Casteljau algorithm)

Recursive definition of any point on the surface as series of


weighted combinations of control points
pij(t) = (1-t) pij-1(t) + t pi+1j-1(t)
for i=0,1,…, n and j=0,1,2,…, n-i.

B
BC
C
ABC ABCD
BCD
AB
CD

A
Fig: Subdivision of a Cubic Bezier Curve D
Contd…

 The point ABCD in on Bezier Curve.


 Control points for first section of Bezier curve
A, AB, ABC and ABCD
 Control points for second section of Bezier curve
ABCD, BCD, CD and D
 This splitting process continues until the sections are no bigger than individual pixels.
Properties of Bezier Curves

1. The curve passes through the start and finish points of the
control polygon defining the curve.
2. The tangent to the curve at t = 0 lies in the direction of the
line joining the first point to the second point. Also the
tangent to the curve at t=1 is in the direction of the line
joining the penultimate point to the last point.
3. Any point on the curve lies inside the convex hull of the
control polygon.
4. All control points affect the entire curve.
5. The order of the curve is related to the number of control
points. Hence using many control points to control the
curve shape means evaluating high order polynomials.
6. The curve is transformed by applying any affine
transformation to its control points and generating the
transformed curve from the transformed control points.
7. No line can intersect the curve more than twice if the four
control points form an open polygon. Thus there can be no
loops in the curve and it must be smooth. This is called the
Variation Diminishing Property.
Bezier Surfaces

 The Bezier curves can be extended to surfaces.


 We can construct a bicubic Bezier surface from a 4*4 grid of control points.
 Recursive subdivision can be used to draw such patches by repeatedly
quartering them until they may be replaced by polygons or pixels.
SPLINE REPRESENTATION

Three representations/specifications of any spline are:

➢ The set of boundary conditions specifying the spline.


➢ The matrix that characterizes the spline.
➢ The set of blending functions that characterizes the spline.

A spline was originally a flexible strip of metal used by a


draughtsman to draw curves.
CUBIC-SPLINES INTERPOLATION METHODS

Suppose we have n+1 control points specified with coordinates

pk = (xk ,yk ,zk ) k=0,1,2,…….n

Equations describing cubic polynomials between each pair of control points:

x(u)= axu3 + bxu2 + cxu + dx


y(u)= ayu3 + byu2 + cyu + dy (0≤u ≤1)
z(u)= azu3 + bzu2 + czu + dz

Given a set of “n+1”control points, we want to define`n`different cubic splines that


interpolate the control points. There are different method for setting the boundary
conditions at the joints between curve sections so that we can obtain numerical values for
all the coefficients.
NATURAL CUBIC SPLINES

➢ The total curve has c2 continuity.

➢ Given ‘n’ curve sections, we have ‘4n’coefficients to calculate.

➢ ‘n-1’ interior points, each provide 4 constraints 


4n-4 equations
- c1 continuity for adjacent splines.
- c2 continuity for adjacent splines.
- c0 continuity : curve n ends at the point, and curve n+1 begins at the
point.
Contd…

➢ Exterior points provide 2 more constraints  4n -4 +2


- the curve ends at each end-point.

➢ Need to specify two more constraints


-set the second derivatives at p0 and pn to 0, or
-specify two dummy points ,one at each end, so that there are
‘n+1’interior points.

Disadvantage- natural cubic splines are globally sensitive to changes at


a single control points.
HERMITE SPLINE

Hermite spline allow local control of a spline. User specifies the tangent at each control point.

Hermite splines can be calculated for two control points pk and pk+1 :
p(0)=pk
p(1)=pk+1
p’(0)=Dpk
p’(1)=Dpk+1

Matrix equivalent of Hermite-curve section


p(u)=au3+bu2+cu+d, 0≤u ≤1
is
p(u)= [u3 u2 u 1] [a b c d]T
Contd…

Set up the derivate form


a 
b 
 .
p’(u)=[3u2 2u 1 0]
c 
 
d 
the complete matrix for the endpoint values 0 and 1
Pk  0 0 0 1 a 
Pk + 1  1
  = 1 1 1   b 
Dp k 
  0 0 1 0  c 
Dpk + 1   
3 2 1 0  d 
Solving for polynomial coefficients ,we have
a  2 - 2 1 1   Pk   Pk 
b  - 3 3 - 2
  =
 
- 1  Pk + 1 

 Pk + 1  = Mh
 
c  0 0 1 0   Dp k   Dp k 
      
d  1 0 0 0   Dpk + 1  Dpk + 1
Where Mh ,the Hermite matrix, is the inverse of the boundary constraint matrix.
Contd…

Drawback –
It requires input values for the curve derivatives at the
control points.

Note- Cardinal splines and Kochanek-Bartels splines (variant


of Hermite splines) do not require above additional
information.
APPROXIMATING SPLINES: B-SPLINE CURVES

B-splines have two advantages over Bézier splines:


(1) the degree of a B-spline polynomial can be set independently of the
number of control points (with certain limitations), and
(2) B-splines allow local control over the shape of a spline.

The tradeoff is that B-splines are more complex than Bézier splines.
APPROXIMATING SPLINES: B-SPLINE CURVES…

There are two major disadvantages of Bezier curves, namely:

1. Their non-localness: while a control point mainly influence the shape of the curves
close to it, it also affects the entire curve to some extent.

2. The fact that the degree of the curve is related to the number of control points.
Thus either high order polynomials have to be used or multiple low-degree curve
segments have to be used.

The B-spline curve gets around these difficulties.


APPROXIMATING SPLINES: B-SPLINE CURVES

Definition –
A B-spline is a set of piecewise (usually cubic) polynomial segments
that pass close to a set of control points.

A B-spline curve P(u) of order k (or degree k-1) is defined as


n

P(u)=  PiNi, k (u)


i =0
Contd…

Where  PiNi, k (u)


i =0

➢ the {Pi : i=0,1,...,n} are the control points.


➢ Ni,k (u) are “normalized B-spline blending functions” of degree k-1.
➢ the parameter u defines a knot vector
u= {u0,u1,…………um}

Here n (no. of control points ), m ( knot points) and k (order of curve) satisfy the following conditions
m=n+k+1

Blending functions Ni,k for B-spline curve are defined by the Cox-deBoor recursion formula:
when k=1
Ni,1(u)= 1, u є [u i , u i+1)
0, otherwise
Contd…

And if k>1

Ni,k(u)= ( u- ui )/ (ui+k-1-ui ) N i,k-1(u) + (ui+ k –u )/(ui+ k –ui+1)Ni+1,k-1 (u)

the order k is independent of the no. of control points (n+1).


Open B-spline

If the knot vector does not have any particular structure, the generated curve will not touch the
first and last lags of the control polygon.

Clamped B-spline
We may want to clamp the curve so that it is tangent to first and last lags just like the Bezier
curve does. To do so, the first knot and the last knot must be repeated (k+1) times. This type
of B-spline curve is called clamped curve.
Closed B-spline

By repeating some knots and control points, the generated curve can be a closed one.

Repeated control points


P0,P1,P2 at the end of the
sequence-
P0,P1,………Pm,P0,P1,P2
Matrix representation

The curve between Pi and Pi+1 is defined by

- 1 3 -3 1  Pi - 1 
3 -6 3 0  Pi 
C i (u) =1/6 [u3 u2 u 1]   
- 3 0 3 0  Pi + 1 
   
1 4 1 0  Pi + 2 
Summary of properties of B-spline curve
Contd…

5. Variation Diminishing and Convex Hull properties hold.

Limitation- B-spline curves (like Bezier curves) are polynomial curves


and can not represent many useful curves such as circles and ellipses.
Thus a generalization of B-spline, called NURBS (Non- Uniform
Rational B-Spline), is required.
Fractals
Modeling Complex Shapes

 Modeling of complex objects is a difficult process.


 In particular, geometric modeling of complex forms or mathematical modeling of complex
systems having non-linear relationship have no unified methodology.
 Natural objects such as coastlines, mountains, cloud formations, trees etc. constitute an
important class of complex objects.
Examples

Fractal fern Fractal cloud Fractal landscape


The Problem
 In order to represent these complex shapes, the traditional methods like the Euclidean
geometry are unable to describe elegantly such complex objects.
 The Euclidean geometry deals with simple shapes like lines and planes, circles and spheres,
triangle and cones etc.
 It is not able to describe complex shapes which may be irregular, fragmented, tangled, twisted
or fractured.
The Solution

 The family of complex shapes may be described by what the French Mathematician Benoit
Mandelbrot (year 1975) called fractals.
 The word ‘fractal’ derives its origin from the Latin word fractus meaning ‘irregular and
fragmented’.
 The fractal geometry has helped to reconnect pure mathematics with natural sciences and
computing.
Euclidean and Fractal Geometry

Geometry is a mathematical language to describe, relate


and manipulate shapes.

Euclidean Fractal
 Traditional (over 2000 years)  Modern monsters (20 years)
 Based on characteristic size & scale  No specific size and scale
 Suits for man-made objects  Appropriate for natural shapes
 Described by a non-recursive formula  Described by algorithm or recursive formula
Fractal: Definition & Properties

 Fractals are infinitely magnifiable irregular objects with fractional dimension which can be
produced by a small set of instructions and data.
 Important properties of fractals are:

➢Self-similarity
➢Fractional Dimensions
➢Ill defined characteristic scale of length
➢Formation by Iteration
1. Self-Similarity
 Geometric figures are similar if they have the same shape
i.e. the corresponding sides are in proportion. For example,
the following two squares are similar.

• The following two rectangles are not similar.

• But the two rectangles below are similar.

Self-similar figure
Self-Similarity of Fractals

 As fractal structure are examined at smaller and smaller scales i.e. as the
view of them is magnified more and more, the smaller scale versions seem to
resemble the large scale version.
 Self-similarity, in other words invariance against change in scale or size, is an
attribute of many laws of nature.
Example: Self-similarity of fractals

Koch Curve
2. Fractional Dimension
Dimension of Geometric Objects

 A point has no dimensions - no length, no width, no height.


 That dot is obviously way too big to really represent a point. But we'll live with it, if we all just
agree what a point really is.
Dimension of Geometric Objects
Contd…

 A line has one dimension - length. It has no width and no height, but infinite length.
 Again, this model of a line is really not very good, but until we learn how to draw a line with 0
width and infinite length, it'll have to do.
Dimension of Geometric Objects
Contd…

 A plane has two dimensions - length and width, no depth.


 It's an absolutely flat tabletop extending out both ways to infinity.
Dimension of Geometric Objects
Contd…

 Space, a huge empty box, has three dimensions, length, width, and depth, extending to
infinity in all three directions.
 Obviously following isn't a good representation of 3-D space. Besides its size, it's just a hexagon
drawn to fool you into thinking it's a box.
Topological Dimension

 We observe that all the geometric objects residing in Euclidean space has integer dimension.
Such a dimension is alternatively also known as topological dimension.
 In general, Euclidean space Rn has dimension n.
 Intuitively, the dimension of the space equals the number of real parameters necessary to
describe different points in the space.
Fractional Dimension
 In fractal geometry, there is another concept of this dimension, that is, here
dimension of an object is not an integer rather a fraction like 1.53, 2.71 etc.
 It is also known as Hausdorff dimension or Fractal dimension.
 Simply this implies that objects are possible where dimension is between 1
and 2.
Mathematical Interpretation

 If we take an object residing in Euclidean dimension D and reduce its linear size by 1/r in each
spatial direction, its measure would increase to N=rD times the original (refer next figure).
 We consider N=rD, take the log of both sides, and get log(N) = D log(r). If we solve for D, then D
= log(N)/log(r).
Figure: Understanding the concept of dimension
Fractional Dimension
Contd…

 In the equation D = log(N)/log(r), the dimension D need not be an integer, as it is in Euclidean


geometry. In fractal geometry, D has fractional values.
 The fractal dimension is related to the degree of roughness or brokenness or irregularity in an
object.
 It has proved useful for describing natural objects and for evaluating trajectories of dynamic
systems.
Examples of Geometric Objects with Non-integer
dimensions
Koch Curve
We begin with a straight line of length 1, called the initiator.
We divide it in three equal parts and then replace the middle
third one by the two adjacent sides (of length 1/3) of an
equilateral triangle. This new form is called the generator,
because it specifies a rule that is used to generate a new
form.

(Length 1)
The Initiator and Generator
for constructing the Koch
(Length 4/3) Curve
Higher Levels of Koch Curve

 The rule says to take each line and replace it with four lines, each one-third the length of the
original.

Level 2 (Length 16/9) Level 3 (Length 64/27)

Doing iteratively large number of times


Dimension of Koch Curve

 Here the line is reduced in scale by 3 i.e. r=3, and generates 4 equal pieces
i.e. N = 4, then
4 = 3D
Solving for D,
D = log 4 / log 3
= 1.2618
Interesting Features of Koch Curve

 Itis a continuous loop that never intersects itself because


the new triangles on each side are always small enough not
to encroach upon each other.
 Other important feature of this curve is that its outline,
which is of infinite length, encloses a finite area.
Sierpinski Triangle

We start with an equilateral


triangle, connect the mid-points
of the three sides and remove
the resulting inner triangle.
3. Ill defined Characteristic scale of length
 Unlike the Euclidean shapes which have characteristic sizes or scales (i.e. radius of sphere, the
edge of a cube etc.), the length of fractal structures depends on the scale of measurement.
(famous question: How long is the coast of Britain?)
 The overall length of a fractal curve tends to infinity as we inspect closer and closer.
4. Formation by Iteration
 Fractals are often formed by what is called an iterative process.
 To make a fractal: Take a familiar geometric figure (a triangle or line segment, for example)
and operate on it so that the new figure is more "complicated" in a special way.
 Then in the same way, operate on that resulting figure, and get an even more complicated
figure.
 Do it again and again infinitely many times.
Non-linear Fractals

 The previous examples were from the examples of Linear fractal geometry. For the creation of such
fractals, we use some rules and these rules are to be applied repeatedly a large number of times to
get the final one.
 On the other hand, in case of Non-Linear fractal, a mathematical formula yields fractal.
 The examples are: Julia set and the Mandelbrot set.
Julia Set
(Self-squaring fractal)

 Obtained by repeatedly applying the mapping z → z2 + c to each


complex number z for some non-zero value of c (fixed c and
varying starting z value).
 In this process, some complex numbers will be attracted to
infinity, some to finite numbers, and some will go toward
neither. Drawing these boundary points, we get the Julia set.
Thus the Julia set of f(z)=z*z is the unit circle.
Mandelbrot set

 Although the Mandelbrot set is self-similar at magnified scales,


the small scale details are not identical to the whole.
 It's the the set of all complex numbers z for which sequence
defined by the iteration (varying c, z(0)=0)
z(0) = z, z(n+1) = z(n)*z(n) + z, n=0,1,2, ... (1) remains bounded. This
means that there is a number B such that the absolute value of
all iterates z(n) never gets larger than B.
Applications of Fractals
 For describing dynamical systems and modeling chaos (e.g. modelling weather pattern).
 For image compression with very high compression ratio.
 For creating special effects in movies.
 In Astronomy for distribution of galaxies.
 For describing and predicting the location and timing of earthquakes.
Applications of Fractals
Contd…
Medical Applications: Human Anatomy

Anatomical Structure Fractal Dimension


Bronchial Tubes very close to 3
Arteries 2.7
Brain 2.73 – 2.79
Alveolar Membrane 2.17
Mitochondrial Membrane (outer) 2.09
Mitochondrial Membrane (inner) 2.53
Endoplasmic Reticulum 1.72

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy