SlideShare a Scribd company logo
Graphic Standards
The heart of any CAD model is the component database. This includes the graphics entities like points, lines,
arcs, circles etc. and the co-ordinate points, which define the location of these entities. This geometric data is
used in all downstream applications of CAD, which include finite element modeling and analysis, process
planning, estimation, CNC programming, robot programming, programming of co-ordinate measuring
machines, ERP system programming and simulation.
In order to achieve at least a reasonably high level of integration between CAD, analysis and manufacturing
operations, the component database must contain:
i. Shapes of the Components (based on solid models)
ii. Bill of Materials (BOM), of the assembly in which the components are used.
iii. Material of the Components
iv. Manufacturing, test and assembly procedures to be carried out to produce a component so that it is
capable of functioning as per the requirements of design.
In designing a data structure for CAD database the following factors are to be considered:
i. The data must be neutral.
ii. The data structure must be user-friendly.
iii. The data must be portable.
In order to achieve the above requirements, some type of standardization has to be followed by the CAD
software designers. The basic elements associated with a CAD system are:
• Operator user
• Graphics Support System
• Other User )nterface Support System
• Application Functions
• Database
A diagrammatic presentation of these elements is given in Figure. The reasons for evolving a graphic standard
thus include:
• Need for exchanging graphic data between different computer systems.
• Need for a clear distinction between modeling and reviewing aspects.
Standards for Graphics Programming
(i) GKS (Graphical Kernel System):
It is an ANSI and ISO standard. GKS standardizes two dimensional graphics functionality at a relatively low
level. The primary purposes of the standard are:
• To provide for portability of graphics application programs.
• To aid in the understanding of graphics method by application programmers.
• To provide guidelines for manufacturers in describing useful graphics capabilities.
The GKS (ANSI X3.124-1985) consists of three basic parts:
i. An informal exposition of contents of the standard, which includes such things as positioning of text, filling
of polygons etc.
ii. A formalization of the expository material outlined in (i) by way of abstracting the ideas into functional
descriptions (input/output parameters, effect of each function etc.).
iii. Language bindings, which are the implementations of the abstract functions, described in (ii) in a specific
computer language like FORTRAN, Ada or C.
The features of GKS include:
i. Device Independence: The standard does not assume that the input or output devices have any particular
features or restrictions.
ii. Text/Annotations: All text or annotations are in a natural language like English.
iii. Display Management: A complete suite of display management functions, cursor control and other
features are provided.
iv. Graphics Functions: Graphics functions are defined in 2D or 3D.
The drivers in GKS also include metafile drivers. Metafiles are devices with no graphic capability like a
disc unit. The GKS always works in a rectangular window or world coordinate system. The window also
defines a scaling factor used to map the created picture into the internal co-ordinate system of GKS
called Normalized Device Co-Ordinates. Windows and view ports can then work in this co-ordinate system.
PHIGS:
P()GS Programmer’s (ierarchical )nteractive Graphics Standard includes in its functionality three
dimensional output primitives and transformations. It has dynamic control over the visual appearance of
attributes of primitives in a segment. The PHIGS standard defines a set of device-independent logical
concepts. Application programmers can use these concepts within a set of PHIGS rules. The major concepts
are the Logical Input Device, PHIGS structure, Structure Networks, Structure Manipulation, Search and
Inquiry, Structure Traversal and Display, the Name Set mechanism, the viewing pipeline, and the PHIGS
workstation.
Fig. GKS Implementation in a CAD Workstation
PHIGS, a programming library for 3D graphics, was developed and maintained by ISO. It is most commonly
used on the X Windows system. The PHIGS high level graphics library contains over 400 functions ranging
from simple line drawing to lighting and shading. Before displaying a picture, the application first stores its
graphics information in the PHIGS graphic database. Therefore PHIGS is referred to as a display list system.
The application then appears on one or more display devices and then passes the list to them.
Exchange of CAD Data between Software Packages
Necessity to translate drawings created in one drafting package to another often arises. For example you may
have a CAD model created in PRO/E package and you may wish that this might be transferred to I-DEAS or
Uni-Graphics. It may also be necessary to transfer geometric data from one software to another. This situation
arises when you would want to carry out modeling in one software, say PRO/E and analysis in another
software, say ANSYS. One method to meet this need is to write direct translators from one software to
another. This means that each system developer will have to produce its own translators. This will
necessitate a large number of translators. If we have three software packages we may require six translators
among them. This is shown in Fig.
Fig. Direct Data Translation
A solution to this problem of direct translators is to use neutral files. These neutral files will have standard
formats and software packages can have pre-processors to convert drawing data to neutral file and
postprocessors to convert neutral file data to drawing file. Figure illustrates how the CAD data transfer is a
accomplished using neutral file. Three types of neutral files are discussed here:
i. Drawing Exchange Files (DXF)
ii. IGES Files
iii. STEP Files
Fig. CAD Data Exchange Using Neutral Files
DXF Files
DXF file (Drawing Exchange File) is a popular data exchange format adopted by many CAD system vendors.
DXF format is easy to interpret though it is a lengthy file. The data pertaining to the drawing entities are
included in the entities section. Fig. shows a plate with a hole.
Initial Graphics Exchange Specification (IGES) Graphics Standard
The IGES committee was established in the year 1979. The CAD/CAM Integrated Information Network (CIIN)
of Boeing served as the preliminary basis of IGES. IGES version 1.0 was released in 1980. IGES continues to
undergo revisions. IGES is a popular data exchange standard today. Figure shows a CAD model of a plate with
a centre hole. The wire frame model of the component is shown in Fig. There are eight vertices (marked as
PNT 0 - PNT 8), 12 edges and two circles that form the entities of the model. Table shows the IGES output of
the wire frame model.
Fig. 3-D Model of a Plate Fig. Wire-frame Model of the Component
IGES files can also be generated for:
i. Surfaces
ii. Datum curves and points
Product Data Exchange Specification (PDES)
A likely alternative to IGES is the Product Data Exchange Specification (PDES) developed by IGES
organization. PDES is aimed at defining a more conceptual model. Parts will be based on solids and defined in
terms of features such as holes, flanges, or ribs. Instead of dimensions PDES will define a tolerance
envelope for the parts to be manufactured. PDES will also contain non-geometric information such as
materials used, manufacturing process and suppliers. PDES will be a complete computer model of the part.
Point and Line, Line Drawing Algorithms
In the case of the computer graphics we have a digitized raster environment so xy are defined as integer
coordinates and we need to actually find out what are those coordinates which fall on the line before we
draw it. So that is the problem in the digitized space, we do not have continuous values of x and y like the
analog world. And hence in the case we need an algorithm by which we draw a line. Display devices raster in
all that we can visualize ourselves the digitized space or a raster space as the matrix or an array of pixels and
definitely if we draw an arbitrary line, not all of this square pixel blocks or raster position will fall on a line. So
we are talking of approximately representing line in that sense truly of course in analog environment you can
say there are basically infinite points which lie on the line. That is not the case, we have a finite set of pixels
which fall on a line and you have to find out which are those finite pixels.
When we define a line we can think of the equation of a line or the staring point x1 y1 and the finishing point
x2 y2 of a line and we can simply draw a line by a scale that is fine. But in the case of a graphic screen which
we are viewing now in a TV or a CRT monitor we have to find out what are those pixels staring from x0 y0 and
so on up to an end point x and y or x1 and y1. What are those points or the addressable pixels is the term used
here in the problem definition which falls in this line. Given the specification of a straight line either in the
form of an equation or the staring point and the end point, if that is given find the collection of addressable
pixels which most closely approximates this line.
The goals of line drawing algorithms:
a) Straight line should appear straight.
b) It should start and end accurately, matching end points with connecting lines.
c) Lines should haze constant brightness.
d) Lines should be drawn as rapidly as possible.
Two line drawing algorithms are:
a) DDA (Digital Differential Analyzer)
b) Bresenham s line drawing algorithm
a) DDA (Digital Differential Analyzer)
1) A line can be specified in the form: y = mx + c
2) Let m be between 0 to 1, then the slope of the line is between 0 and 45 degrees.
3) For the x-coordinate of the left end point of the line, compute the corresponding y value according to the
line equation. Thus we get the left end point as (x1, y1), where y1 may not be an integer.
4) Calculate the distance of (x1, y1) from the center of the pixel immediately above it and call it D1
5) Calculate the distance of (x1, y1) from the center of the pixel immediately below it and call it D2
6) If D1 is smaller than D2, it means that the line is closer to the upper pixel than the lower pixel, then, we set
the upper pixel to on; otherwise we set the lower pixel to on.
7) Then increment x by 1 and repeat the same process until x reaches the right end point of the line.
8) This method assumes the width of the line to be zero.
DDA Algorithm:
1. Define the nodes, i.e end points in form of (x1, y1) and (x2, y2).
2. Calculate the distance between the two end points vertically and horizontally, i.e dx = |x1- x2| and dy =|y1 -
y2|.
3. Define new variable name pixel , and compare dx and dy values,
if dx > dy then
pixel = dx
else
pixel = dy.
4. dx = dx/pixel; and dy = dy/pixel
5. x = x1; y = y1;
6. while (i <= pixel) compute the pixel and plot the pixel with x = x + dx and y = y + dy.
b) Bresenham's Line Algorithm
1. Input the two line endpoints and store the left endpoint in (xo, yo)
2. Load (xo, yd) into the frame buffer; that is, plot the first point.
3. Calculate constants Δx, Δy, 2Δy, and 2Δy – 2Δx, and obtain the starting value for the decision parameter as
po = 2Δy - Δx
4. At each xk along the line, starting at k = 0, perform the following test: If pk < 0, the next point to plot is
(xk+1, yk) and pk+1 = pk - 2Δy
Otherwise, the next point to plot is (xk+1, yk+1) and pk+1 = pk + 2Δy - 2Δx
5. Repeat step 4 Δx times.
Mid Point Circle Algorithm
1) Input radius r and circle center (x, y,), and obtain the first point on the circumference of a circle centered
on the origin as (x0, y0) = (0, r)
2) Calculate the initial value of the decision parameter as p0 = 54 – r
3) At each xk position, starting at k = 0, perform the following test: If pk < 0, the next point along the circle
centered on (0,0) is (xk+1, yk) and pk+1 = pk +2xk+1+1
Otherwise, the nest point along the circle is (xk+1, yk+1) and pk+1 = pk+2xk+1 + 1 - 2yk+1
where 2xk+1= 2xk + 2 and 2yk+1= 2yk - 2.
4. Determine symmetry points in the other seven octants.
5. Move each calculated pixel position (x, y) onto the circular path centered on (xc, yc) and plot the coordinate
values: x = x + xc, y = y + yc
6. Repeat steps 3 through 5 until x >= y.
Basic Transformation
Animations are produced by moving the 'camera' or the objects in a scene along animation paths. Changes in
orientation, size and shape are accomplished with geometric transformations that alter the coordinate
descriptions of the objects. The basic geometric transformations are translation, rotation, and scaling. Other
transformations that are often applied to objects include reflection and shear.
Use of Transformation in CAD
In mathematics, "Transformation" is the elementary term used for a variety of operation such as rotation,
translation, scaling, reflection, shearing etc. CAD is used throughout the engineering process from conceptual
design and layout, through detailed engineering and analysis of components to definition of manufacturing
methods. Every aspect of modeling in CAD is dependent on the transformation to view model from different
directions we need to perform rotation operation. To move an object to a different location translation
operation is done. Similarly Scaling operation is done to resize the object.
Coordinate Systems
In CAD three types of coordinate systems are needed in order to input, store and display model geometry and
graphics. These are the Model Coordinate System (MCS), the World Coordinate System (WCS) and the Screen
Coordinate System (SCS).
1. Model Coordinate System (MCS):
The MCS is defined as the reference space of the model with respect to which all the model geometrical data is
stored. The origin of MCS can be arbitrary chosen by the user.
2. World Coordinate System (WCS)
Every object has its own MCS relative to which its geometrical data is stored. Incase of multiple objects in the
same working space then there is need of a World Coordinate System which relates each MCS to each other
with respect to the orientation of the WCS.
3. Screen Coordinate System (SCS)
In contrast to the MCS and WCS the Screen Coordinate System is defined as a two dimensional device-
dependent coordinate system whose origin is usually located at the lower left corner of the graphics display
as shown in the picture below. A transformation operation from MCS coordinates to SCS coordinates is
performed by the software before displaying the model views and graphics.
Viewing Transformations
As discussed that the objects are modeled in WCS, before these object descriptions can be projected to the
view plane, they must be transferred to viewing coordinate system. The view plane or the projection plane is
set up perpendicular to the viewing zv axis. The World coordinate positions in the scene are transformed to
viewing coordinates, and then viewing coordinates are projected onto the view plane. The transformation
sequence to align WCS with Viewing Coordinate System is.
1. Translate the view reference point to the origin of the world coordinate system.
2. Apply rotations to align xv, yv, and zv with the world xw, yw and zw axes, respectively.
Translation
A translation is applied to an object by repositioning it along a straight line path from one coordinate location
to another. We translate a two-dimensional point by adding translation distances, tx and ty, to the original
coordinate position (x,y) to move the point to a new position (x',y')
′
= +
′
= +
The translation distance pair (tx, ty) is called translation vector or shift vector.
�� � � � � � � , [ ′ ′ ] = [ ] + [ + ]
This allows us to write the two-dimensional translation equations in the matrix form:
�′
= � +
Rotation
A two-dimensional rotation is applied to an object by repositioning it along a circular path in the x-y plane.
When we generate a rotation we get a rotation angle θ and the position about which the object is
rotated (xr ,yr) this is known as rotation point or pivot point. The transformation can also be described as a
rotation about rotation axis that is perpendicular to x-y plane and passes through the pivot point.
Positive values for the rotation angle define counter-clockwise rotations about the pivot point and the
negative values rotate objects in the clockwise direction. Suppose the pivot point be at origin, to understand
the relationship between angular and coordinate points of original and transformed position
r - Constant distance of the point from the origin; Φ - Original angular position of the point from the
horizontal; θ - Rotation angle
We can express the transformation by the following equations
′
= �� � + � ′
= � � � + �
We know the coordinate of x and y in polar form
′
= �� � ′
= � � �
on expanding and equating we get
′
= � � − � � ; ′
= � � − � �
The same equations we can write in matrix form as
�′
= �.
Where the rotation matrix R is
= [
� � � �
− � � � �
]
Hence it is
[ ′
′] = [ ] [
� � � �
− � � � �
]
Scaling
Scaling is a kind of transformation in which the size of an object is changed. Remember the change in size
does not mean any change in shape. This kind of transformation can be carried out for polygons by
multiplying each coordinate of the polygon by the scaling factor. Sx and Sy which in turn produces new
coordinate of (x,y) as (x',y'). The equation would look like
[ ′ ′
] = [ ] [ ]
�′
= �.
here S represents the scaling matrix.
Note: If the values of scaling factor are greater than 1 then the object is enlarged and if it is less that 1 it
reduces the size of the object. Keeping value as 1 does not changes the object.
Uniform Scaling: To achieve uniform scaling the values of scaling factor must be kept equal.
Differential Scaling: Unequal or Differential scaling is produce incases when values for scaling factor are not
equal. As per usual phenomenon of scaling, an object moves closer to origin when the values of scaling factor
are less than 1. To prevent object from moving or changing its position while is scaling we can use a point that
is would be fixed to its position while scaling which is commonly referred as fixed point (xf ,yf).
Reflection
Reflection is nothing more than a rotation of the object by 180o. In case of reflection the image formed is on
the opposite side of the reflective medium with the same size. Therefore we use the identity matrix with
positive and negative signs according to the situation respectively.
The reflection about the x-axis can be shown as:
= [
−
]
The reflection about the y-axis can be shown as:
= [
−
]
Reflection about an Origin:
When both the x and y coordinates are flipped then the reflection produced is relative to an axis that is
perpendicular to x-y plane and that passes through the coordinate origin. This transformation is referred as a
reflection relative to coordinate origin and can be represented using the matrix below.
=
[
−
−
]
Reflection about an Arbitrary Line:
Reflection about any line y = mx + c can be accomplished with a combination of translate-rotate-reflect
transformations.
Steps are as follows:
1. Translate the working coordinate system (WCS) so that the line passes through the origin.
2. Rotate the WCS such that one of the coordinate axes lies onto the line.
3. Reflect about the aligned axis
4. Restore the WCS back by using the inverse rotation and translation transformation.
Homogeneous Coordinates
We have seen that basic transformations can be expressed in matrix form. But many graphic applications
involve sequences of geometric transformations. Hence we need a general form of matrix to represent
such transformations. This can be expressed as:
�′
= �. +
Where P and P' - represent the row vectors.
T1 - is a 2 by 2 array containing multiplicative factors.
T2 - is a 2 element row matrix containing translation terms.
We can combine multiplicative and translational terms for 2D geometric transformations into a single matrix
representation by expanding the 2 by 2 matrix representations to 3 by 3 matrices. This allows us to express
all transformation equations as matrix multiplications, providing that we also expand the matrix
representations for coordinate positions. To express any 2D transformations as a matrix multiplication, we
represent each Cartesian coordinate position (x,y) with the homogeneous coordinate triple (xh,yh,h),such
that
[ �] = [ � �⁄⁄ ] = [ � �⁄⁄ ]
Thus, a general homogeneous coordinate representation can also be written as (h.x, h.y, h). For 2D geometric
transformations, we can choose the homogeneous parameter h to any non-zero value. Thus, there is an
infinite number of equivalent homogeneous representations for each coordinate point (x,y).
A convenient choice is simply to h = 1. Each 2D position is then represented with homogeneous
coordinates (x, y, 1). Other values for parameter h are needed, for eg, in matrix formulations of 3D viewing
transformations. Expressing positions in homogeneous coordinates allows us to represent all geometric
transformation equations as matrix multiplications. Coordinates are represented with three element row
vectors and transformation operations are written as 3 by 3 matrices.
� � � � � � � , [ ′ ′ ] = [ ].
[ ]
or �′
= �. ,
� � � � � � , [ ′ ′
] = [ ].
[
� � � �
− � � � �
]
or �′
= �. �
�� � � � � , [ ′ ′
] = [ ].
[ ]
or �′
= �. ,
2D Composite Transformation
With the matrix representations of the transformations, we can set up a matrix for any sequence of
transformations as a composite transformation matrix by calculating the matrix product of the individual
transformations. If two successive transformations T1 and T2 are applied to a coordinate position P, the final
transformed location P' is calculated as:
�. = � . = �
Where = . )
1. Translation
In translation, an object is displayed a given distance and direction from its original position. If the
displacement is given by the vector = ̂ + ̂ the new object point P'(x',y') can be found by applying the
transformation Tv to P(x,y)
�′
= �
where ′
= + and ′
= +
= ( )
[ ]
; =
[ ]
= + +
[ + + ]
2. Rotation
A generalized rotation about an arbitrary point (a, b) can be obtained by performing the following
transformations:
1. Translate the object so that the pivot-point position is moved to coordinate origin.
2. Rotate the object about the coordinate origin.
3. Translate the object so that the pivot point is returned to its original position.
4. The composite matrix for this sequence is obtained as:
= . .
=
[ − − ]
=
[
� � � �
− � � � �
]
=
[ ]
= [
� � � �
− � � � �
− � � + � � − � � − � �
]
3. Scaling
The animation illustrates a transformation sequence to produce scaling with respect to a selected fixed
position (a,b) using a scaling function that can only scale relative to the coordinate origin.
1. Translate object so that the fixed point coincides with the coordinate origin.
2. Scale the object with respect to the coordinate origin.
3. Use the inverse translation of step 1 to return the object to its original position.
4. The composite matrix for this sequence is obtained as:
= . . Where,
= [
− –
] = [ ] = [ ]
= [
− ( − )
]
3D- Transformations
1. Translation:
In three-dimensional homogeneous coordinate representation, when a point P is translated to P' with
coordinated (x, y, z) and x', y’, z’ can be represented in matrix form as:
P’ = P.T
Where, P = [x y z]; P’ = [x’ y’ z’]; X’ = X + TX ; y’ = y + Ty ; z’ = z + Tz
= [ ]
2. Rotation
Unlike 2D, rotation in 3D is carried out around any line. The most simple rotations could be around
coordinate axis. As in 2D positive rotations produce counter-clockwise rotations. Rotation in term of general
equation is expressed as
P’ = P.R θ)
Where, P = [x y z]; P’ = [x’ y’ z’]
R = Rotation Matrix
Rotation matrix when an object is rotated about X axis can be expressed as:
=
[
� � � �
− � � � �
]
Rotation matrix when an object is rotated about Y axis can be expressed as:
=
[
� � − � �
� � � �
]
Rotation matrix when an object is rotated about Z axis can be expressed as:
=
[
� � � �
− � � � �
]
3. Scaling
Scaling an object in three-dimensional is similar to scaling an object in two-dimensional. Similar to 2D scaling
an object tends to change its size and repositions the object relative to the coordinate origin. If the
transformation parameters are unequal it leads to deformation of the object by changing its dimensions. The
perform uniform scaling the scaling factors should be kept equal i.e.
Sx = Sy = Sz ; P’ = P.S
Where, P = [x y z]; P’ = [x’ y’ z’]
=
[ ]
Note: A special case of scaling can be represented as reflection. If the value of Sx, Sy or Sz be replaced by -1 it
will return the reflection of the object against the standard plane whose normal would be either x axis, y axis
or z axis respectively.
4. Reflection
In 3D-reflection the reflection takes place about a plane whereas 2D reflection it used take place about an
axis. The matrix in case of pure reflections, along basic planes, viz. X-Y plane, Y-Z plane and Z-X plane are
given below:
Transformation matrix for a reflection through X-Y plane is: =
[
−
]
Transformation matrix for a reflection through Y-Z plane is: =
[
−
]
Transformation matrix for a reflection through Z-X plane is: =
[
−
]
General 3-D Rotation
Rotation in three dimensions is more complex than the rotation in two dimensions. Three dimensional
rotations require the prescription of an angle of rotation and an axis of rotation. The canonical rotations are
defined when one of the positive x, y, z coordinate axis is chosen as the axis of rotation. Then the construction
of rotation transformation proceeds just like that of a rotation in two dimensions about the origin.
Steps to be Performed:
1. Translate origin to A1
=
[ ]
2. Align vector with axis (say, z)
Rotate to bring vector in yz plane
=
[
� � − � �
� � � �
]
Rotate to bring vector along z-axis
=
[
� � � �
− � � � �
]
3. Rotate line P1P2 about z-axis which is already aligned with the Rotation axis.
4. Reverse steps 2
5. Reverse step 1
Representing All Transformations as Matrix Multiplications
Two Dimensional coordinates are represented using three-element column vectors, and Transformation
operation is represented by 3 x 3 matrices.
[x’ y’ z’ ] = [x y z].[ ]
which can be written in abbreviated form as P’ = P.T tx , ty)
Capturing Composite Transformations Conveniently
On the basis of the matrix product of the individual transformations we can set up a matrix for any sequence
of transformation known as composite transformation matrix. For row-matrix representation we form
composite transformations by multiplying matrices in order from left to right whereas in column-matrix
representation we form composite transformations by multiplying matrices in order from right to left.
Non Linear Transformations (3D -Perspective Transformations)
Standard Perspective Projection:
A Perspective Transformation is the transformation from one three space in to another three space. In
contrast to the Parallel Transformation, in perspective transformations parallel lines converge, object
size is reduced with increasing distance from the center of projection, and non uniform foreshortening
of lines in the object as a function of orientation and the distance of the object from the center of projection
occurs. All of these effects laid the depth perception of the human visual system, but the shape of the object is
not preserved. Perspective Drawings are characterized by Perspective Foreshortening and Vanishing
Points.
Perspective Foreshortening is the illusion that object and lengths appear smaller as there distance
from the center of projection increases. The illusion that certain sets of parallel lines appear to meet at a
point is another feature of perspective drawings. These points are called Vanishing Points .Principal
vanishing points are formed by the apparent intersection of lines parallel to one of the three x,y or z
axis. The number of principal vanishing points is determined by the number of principal axes interested by
the view plane.
Perspective Anomalies
1. Perspective Foreshortening: The farther an object is from the center of projection, the smaller it appears.
2. Vanishing Points: Projections of lines that are not parallel to the view plane (i.e. lines that are not
perpendicular to the view plane normal) appear to meet at some point on the view plane. This point is called
the vanishing point. A vanishing point corresponds to every set of parallel lines. Vanishing points
corresponding to the three principle directions are referred to as "Principle Vanishing Points (PVPs)". We
can thus have at most three PVPs. If one or more of these are at infinity (that is parallel lines in that direction
continue to appear parallel on the projection plane), we get 1 or 2 PVP perspective projection.
Transformation Matrix for Standard Perspective Projection
View plane at
= ; ′
= − ; ′
= − ; ′
= − ( − � ) ∗
′
= [ ] − ∗ [ − − ( − � )]
=
−
− �
′
= ∗ − =
∗ � −
− �
′
=
−
− �
�imilarl� ′
=
−
− �
; ′
=
=
[
− −
� �
]
Transforming a Point or Transforming the Axis
Graphics applications often require transformation of objects description form one coordinate system to
another. The process of transformation involves steps like translation and rotation. This transformation can
be done in two different ways either by transforming a point of the object or by transforming the axis to a
point on object. Both of these methods are literally as well as mathematically opposite to each other. For
example the matrix for translating point P(x, y, z) to origin the matrix would be exactly the mathematical
inverse of the matrix for translating Origin to point P.
�ran�la�ion ma�ri� �o �ran�la�� poin� � �o ori�in, = [
− −
]
�ran�la�ion ma�ri� �o �ran�la�� ori�in �o poin� � , = [ ]
This is true for rotation matrix also.
How to Determine the Angle of Rotation?
In various situations for performing complex transformations first we need to align an arbitrary line with the
standard axis. To align the standard axis with an arbitrary line it is important to know the angle of rotations.
As show in the figure above the angle θ2 is the angle for rotation about x axis so as to align z axis with the
projection of A1A2 on YZ plane. Thereafter with the same position of z axis rotation of θ2 is taken about Y axis
which aligns the Z axis with the arbitrary line. The angles can be calculated as below.
� = � −
√ +
√ + +
; � = � −
(
√ +
)
Representing Points at Infinity
Homogeneous coordinates can be used to display a point at infinity. For example
[ ] = [ ]
In the above example the point at infinity is presented in the form of homogeneous coordinates. This is often
needed when we want to represent a point at infinity in a certain direction. For instance, for finding the
vanishing point in perspective projections we can transform the point at infinity in the given direction.
General 3-D Reflection
Some orientations of a three dimensional object cannot be obtained using pure rotations; they require
reflections. In three dimensions, reflection occurs through a plane. By analogy with the previous discussion of
two dimensional reflection three dimensional reflections through a plane is equivalent to rotation about an
axis in three dimensional spaces out in to four dimensional space and back into three dimensional spaces. For
pure reflection the determinant of the reflection matrix is identically -1
Steps to Be Performed:
1. Translate origin to A1
=
[ ]
2. Align vector with axis (say, z)
Rotate to bring vector in yz plane
=
[
� � − � �
� � � �
]
3. Rotate to bring vector along z-axis
= [
� � � �
− � � � �
]
4. Reflect the line P1P2 through the standard y-z plane.
5. Reverse steps 2
6. Reverse step 1
Orthographic Projection
The simplest of the Parallel projections is the orthographic projection, commonly used for engineering
drawings. They accurately show the correct or true size and shape of single plane face of an object.
Orthographic projections are projections onto one of the coordinate planes x = 0, y = 0, z = 0.The matrix for
projection onto the z plane is
� =
[ ]
Notice that the third column (the z column) is all zeros. Consequently, the effect of the transformation is to set
the z coordinate of a position vector to zero. Similarly, the matrices for projection on to x = 0 and y = 0 planes
are:
� =
[ ]
an� � =
[ ]
Axonometric Projection
A single orthographic projection fails to illustrate the general three-dimensional shape of an object.
Axonometric projections overcome this limitation. An axonometric projection is constructed by
manipulating the object using rotations and translations, such that at least three adjacent faces are
shown. The result is then projected from the center of projection at infinity on to one of the coordinate plane
unless a face is parallel to the plane of projection, an axonometric projection does not show its true shape.
However, the relative lengths of originally parallel lines remain constant, i.e., parallel lines are equally
foreshortened.
Foreshortening Factor
It is the ratio of the projected length of a line to its true length. Types of axonometric projections:
1. Trimetric
2. Dimetric
3. Isometric
Trimetric projection is the least restrictive and isometric projection is the most restrictive.
Trimetric Projection
A trimetric projection is formed by arbitrary rotations in arbitrary order, about any or all of the
coordinate axes, followed by parallel projection on to the z = 0 plane. The wide variety of trimetric
projections precludes giving a general equation for these ratios. For any specific trimetric projection, the
foreshortening ratios are obtained by applying transformation matrix to the unit vector along the principal
axis specifically,
[ ][ ] = [ ] [ ] = [
∗ ∗
∗ ∗
∗ ∗
]
where [U] is the matrix of unit vectors along the untransformed x, y and z axes respectively, and [T] is the
concatenated trimetric projection matrix. The foreshortening factors along the projected principal axes are
then
� = √ ∗ + ∗ ; � = √ ∗ + ∗ ; � = √ ∗ + ∗
Oblique Projection:
Oblique projections illustrate the general 3 dimensional shape of the object. However only faces of the object
parallel to the plane of projection are shown at there true size and shape that is angles and lengths are
preserved for these faces only. In fact, the oblique projection of these faces is equivalent to an
orthographic front view.
Types of Oblique Projections
1. Cavalier
2. Cabinet
Cavalier Projection
A cavalier projection is obtained when the angle between oblique projectors and the plane of projection is 450
degree. In a cavalier projection the foreshortening factors for all three principal directions are equal. The
resulting figure appears too thick. A cabinet projection is used to correct this deficiency.
Cabinet Projection
An oblique projection for which the foreshortening factor for edges perpendicular to the plane of projection is
one half is called a Cabinet Projection.

More Related Content

What's hot

Input of graphical data
Input of graphical dataInput of graphical data
Input of graphical data
Rajapriya82
 
1.arithmetic & logical operations
1.arithmetic & logical operations1.arithmetic & logical operations
1.arithmetic & logical operations
mukesh bhardwaj
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
Amit Kapoor
 
Overview of the graphics system
Overview of the graphics systemOverview of the graphics system
Overview of the graphics system
Kamal Acharya
 
Designing State Machine
Designing State MachineDesigning State Machine
Designing State Machine
Abhilash Nair
 
Viewing transformation
Viewing transformationViewing transformation
Viewing transformationUdayan Gupta
 
Matrix representation- CG.pptx
Matrix representation- CG.pptxMatrix representation- CG.pptx
Matrix representation- CG.pptx
RubaNagarajan
 
2d/3D transformations in computer graphics(Computer graphics Tutorials)
2d/3D transformations in computer graphics(Computer graphics Tutorials)2d/3D transformations in computer graphics(Computer graphics Tutorials)
2d/3D transformations in computer graphics(Computer graphics Tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Finite state automaton
Finite state automatonFinite state automaton
Finite state automaton
AmmAr mobark
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
KKARUNKARTHIK
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinatesTarun Gehlot
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
Nareek
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
sabbirantor
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
Motaz Saad
 
Spline representations
Spline representationsSpline representations
Spline representations
Nikhil krishnan
 
Clipping
ClippingClipping
Clipping
AMIT VIRAMGAMI
 
line clipping
line clipping line clipping
line clipping
Saurabh Soni
 
Graphics software
Graphics softwareGraphics software
Graphics softwareMohd Arif
 
Dip mcq2
Dip mcq2Dip mcq2
Dip mcq2
Antony Vigil
 

What's hot (20)

Input of graphical data
Input of graphical dataInput of graphical data
Input of graphical data
 
1.arithmetic & logical operations
1.arithmetic & logical operations1.arithmetic & logical operations
1.arithmetic & logical operations
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
 
Overview of the graphics system
Overview of the graphics systemOverview of the graphics system
Overview of the graphics system
 
Designing State Machine
Designing State MachineDesigning State Machine
Designing State Machine
 
Viewing transformation
Viewing transformationViewing transformation
Viewing transformation
 
Matrix representation- CG.pptx
Matrix representation- CG.pptxMatrix representation- CG.pptx
Matrix representation- CG.pptx
 
2d/3D transformations in computer graphics(Computer graphics Tutorials)
2d/3D transformations in computer graphics(Computer graphics Tutorials)2d/3D transformations in computer graphics(Computer graphics Tutorials)
2d/3D transformations in computer graphics(Computer graphics Tutorials)
 
Finite state automaton
Finite state automatonFinite state automaton
Finite state automaton
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
 
Spline representations
Spline representationsSpline representations
Spline representations
 
Clipping
ClippingClipping
Clipping
 
line clipping
line clipping line clipping
line clipping
 
Graphics software
Graphics softwareGraphics software
Graphics software
 
Dip mcq2
Dip mcq2Dip mcq2
Dip mcq2
 
Bresenham circle
Bresenham circleBresenham circle
Bresenham circle
 

Viewers also liked

Introduction to Computer Graphics
Introduction to Computer GraphicsIntroduction to Computer Graphics
Introduction to Computer Graphics
Yatin Singh
 
Mos unit ii
Mos unit iiMos unit ii
Mos unit ii
Yatin Singh
 
Def numerical
Def numericalDef numerical
Def numerical
Yatin Singh
 
Assignment 2
Assignment 2Assignment 2
Assignment 2
Yatin Singh
 
Assignment 4
Assignment 4Assignment 4
Assignment 4
Yatin Singh
 
Friction Drives
Friction DrivesFriction Drives
Friction Drives
Yatin Singh
 
Unit 3
Unit 3Unit 3
Surfaces
SurfacesSurfaces
Surfaces
Yatin Singh
 
Mechanical properties
Mechanical propertiesMechanical properties
Mechanical properties
Yatin Singh
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
PrathimaBaliga
 
Beam deflection gere
Beam deflection gereBeam deflection gere
Beam deflection gere
Yatin Singh
 
Gears and Gear Trains
Gears and Gear TrainsGears and Gear Trains
Gears and Gear Trains
Yatin Singh
 
Finite Element Method
Finite Element MethodFinite Element Method
Finite Element Method
Yatin Singh
 
Unit 1 notes
Unit 1 notesUnit 1 notes
Unit 1 notes
Mahesh Pancity
 
Curves
CurvesCurves
Curves
Yatin Singh
 
Assignment shear and bending
Assignment shear and bendingAssignment shear and bending
Assignment shear and bending
Yatin Singh
 
Modeling Transformations
Modeling TransformationsModeling Transformations
Modeling Transformations
Tarun Gehlot
 
Assignment 3
Assignment 3Assignment 3
Assignment 3
Yatin Singh
 
Combined bending and direct stresses
Combined bending and direct stressesCombined bending and direct stresses
Combined bending and direct stresses
Yatin Singh
 

Viewers also liked (20)

Introduction to Computer Graphics
Introduction to Computer GraphicsIntroduction to Computer Graphics
Introduction to Computer Graphics
 
Mos unit ii
Mos unit iiMos unit ii
Mos unit ii
 
Def numerical
Def numericalDef numerical
Def numerical
 
Assignment 2
Assignment 2Assignment 2
Assignment 2
 
Assignment 4
Assignment 4Assignment 4
Assignment 4
 
Friction Drives
Friction DrivesFriction Drives
Friction Drives
 
Unit 3
Unit 3Unit 3
Unit 3
 
Surfaces
SurfacesSurfaces
Surfaces
 
Mechanical properties
Mechanical propertiesMechanical properties
Mechanical properties
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Beam deflection gere
Beam deflection gereBeam deflection gere
Beam deflection gere
 
Gears and Gear Trains
Gears and Gear TrainsGears and Gear Trains
Gears and Gear Trains
 
Finite Element Method
Finite Element MethodFinite Element Method
Finite Element Method
 
Unit 1 notes
Unit 1 notesUnit 1 notes
Unit 1 notes
 
Curves
CurvesCurves
Curves
 
Assignment shear and bending
Assignment shear and bendingAssignment shear and bending
Assignment shear and bending
 
Modeling Transformations
Modeling TransformationsModeling Transformations
Modeling Transformations
 
Assignment 3
Assignment 3Assignment 3
Assignment 3
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Combined bending and direct stresses
Combined bending and direct stressesCombined bending and direct stresses
Combined bending and direct stresses
 

Similar to Graphics Standards and Algorithm

CAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECHCAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECH
RAJESHS631800
 
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media FactoryDigital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
Massimo Menichinelli
 
Graphic standards and exchange formats
Graphic standards and exchange formatsGraphic standards and exchange formats
Graphic standards and exchange formats
kishor kumar
 
Unit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptx
Unit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptxUnit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptx
Unit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptx
dinesh babu
 
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
RamanathanSabesan
 
IRW 2004
IRW  2004IRW  2004
IRW 2004
Umit Isikdag
 
Graphical interfacing standards
Graphical interfacing standardsGraphical interfacing standards
Graphical interfacing standards
vaibhav tailor
 
UNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdfUNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdf
DURAIMURUGANM2
 
UDMS 2004
UDMS 2004UDMS 2004
UDMS 2004
Umit Isikdag
 
11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...
11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...
11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...Alexander Decker
 
Mod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdfMod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdf
DavidsonJebaseelan1
 
A CAD ppt 25-10-19.pdf
A CAD ppt 25-10-19.pdfA CAD ppt 25-10-19.pdf
A CAD ppt 25-10-19.pdf
KeerthanaP37
 
Computer graphics 9068
Computer graphics  9068Computer graphics  9068
Computer graphics 90681061992
 
UNIT III CAD STANDARDS
UNIT III CAD STANDARDS UNIT III CAD STANDARDS
UNIT III CAD STANDARDS
ravis205084
 
Ugif 10 2012 lycia2 introduction in 45 minutes
Ugif 10 2012 lycia2 introduction in 45 minutesUgif 10 2012 lycia2 introduction in 45 minutes
Ugif 10 2012 lycia2 introduction in 45 minutesUGIF
 
Solidworks software
Solidworks softwareSolidworks software
Solidworks software
sanjeev kumar shah
 
AutoCAD Tutorial AB.pptx
AutoCAD Tutorial AB.pptxAutoCAD Tutorial AB.pptx
AutoCAD Tutorial AB.pptx
Arba Minch University
 
Unit 5-cad standards
Unit 5-cad standardsUnit 5-cad standards
Unit 5-cad standards
Javith Saleem
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
smruti sarangi
 

Similar to Graphics Standards and Algorithm (20)

CAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECHCAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECH
 
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media FactoryDigital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
 
Graphic standards and exchange formats
Graphic standards and exchange formatsGraphic standards and exchange formats
Graphic standards and exchange formats
 
Unit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptx
Unit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptxUnit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptx
Unit 3-ASSEMBLY OF PARTS AND CAD STANDARDS.pptx
 
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
 
IRW 2004
IRW  2004IRW  2004
IRW 2004
 
Graphical interfacing standards
Graphical interfacing standardsGraphical interfacing standards
Graphical interfacing standards
 
UNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdfUNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdf
 
UDMS 2004
UDMS 2004UDMS 2004
UDMS 2004
 
11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...
11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...
11.design and modeling of tool trajectory in c0000www.iiste.org call for pape...
 
Mod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdfMod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdf
 
A CAD ppt 25-10-19.pdf
A CAD ppt 25-10-19.pdfA CAD ppt 25-10-19.pdf
A CAD ppt 25-10-19.pdf
 
Computer graphics 9068
Computer graphics  9068Computer graphics  9068
Computer graphics 9068
 
Q Cad Presentation
Q Cad PresentationQ Cad Presentation
Q Cad Presentation
 
UNIT III CAD STANDARDS
UNIT III CAD STANDARDS UNIT III CAD STANDARDS
UNIT III CAD STANDARDS
 
Ugif 10 2012 lycia2 introduction in 45 minutes
Ugif 10 2012 lycia2 introduction in 45 minutesUgif 10 2012 lycia2 introduction in 45 minutes
Ugif 10 2012 lycia2 introduction in 45 minutes
 
Solidworks software
Solidworks softwareSolidworks software
Solidworks software
 
AutoCAD Tutorial AB.pptx
AutoCAD Tutorial AB.pptxAutoCAD Tutorial AB.pptx
AutoCAD Tutorial AB.pptx
 
Unit 5-cad standards
Unit 5-cad standardsUnit 5-cad standards
Unit 5-cad standards
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 

More from Yatin Singh

Cams and Followers
Cams and FollowersCams and Followers
Cams and Followers
Yatin Singh
 
Kinematic Synthesis
Kinematic SynthesisKinematic Synthesis
Kinematic Synthesis
Yatin Singh
 
Mechanisms
MechanismsMechanisms
Mechanisms
Yatin Singh
 
Deflection in beams
Deflection in beamsDeflection in beams
Deflection in beams
Yatin Singh
 
Mos short answers
Mos short answersMos short answers
Mos short answers
Yatin Singh
 
Members subjected to axisymmetric loads
Members subjected to axisymmetric loadsMembers subjected to axisymmetric loads
Members subjected to axisymmetric loads
Yatin Singh
 
Mos unit iii
Mos unit iiiMos unit iii
Mos unit iii
Yatin Singh
 
Mos unit v
Mos unit vMos unit v
Mos unit v
Yatin Singh
 
Mos unit iv
Mos unit ivMos unit iv
Mos unit iv
Yatin Singh
 
Numericals curved bar
Numericals curved barNumericals curved bar
Numericals curved bar
Yatin Singh
 
Principal stress
Principal stressPrincipal stress
Principal stress
Yatin Singh
 
Mos unit ii
Mos unit iiMos unit ii
Mos unit ii
Yatin Singh
 
Uniaxial stresses
Uniaxial stressesUniaxial stresses
Uniaxial stresses
Yatin Singh
 
Torsion of circular shafts
Torsion of circular shaftsTorsion of circular shafts
Torsion of circular shafts
Yatin Singh
 
Unsymmetrical bending and shear centre
Unsymmetrical bending and shear centreUnsymmetrical bending and shear centre
Unsymmetrical bending and shear centre
Yatin Singh
 

More from Yatin Singh (15)

Cams and Followers
Cams and FollowersCams and Followers
Cams and Followers
 
Kinematic Synthesis
Kinematic SynthesisKinematic Synthesis
Kinematic Synthesis
 
Mechanisms
MechanismsMechanisms
Mechanisms
 
Deflection in beams
Deflection in beamsDeflection in beams
Deflection in beams
 
Mos short answers
Mos short answersMos short answers
Mos short answers
 
Members subjected to axisymmetric loads
Members subjected to axisymmetric loadsMembers subjected to axisymmetric loads
Members subjected to axisymmetric loads
 
Mos unit iii
Mos unit iiiMos unit iii
Mos unit iii
 
Mos unit v
Mos unit vMos unit v
Mos unit v
 
Mos unit iv
Mos unit ivMos unit iv
Mos unit iv
 
Numericals curved bar
Numericals curved barNumericals curved bar
Numericals curved bar
 
Principal stress
Principal stressPrincipal stress
Principal stress
 
Mos unit ii
Mos unit iiMos unit ii
Mos unit ii
 
Uniaxial stresses
Uniaxial stressesUniaxial stresses
Uniaxial stresses
 
Torsion of circular shafts
Torsion of circular shaftsTorsion of circular shafts
Torsion of circular shafts
 
Unsymmetrical bending and shear centre
Unsymmetrical bending and shear centreUnsymmetrical bending and shear centre
Unsymmetrical bending and shear centre
 

Recently uploaded

The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

Graphics Standards and Algorithm

  • 1. Graphic Standards The heart of any CAD model is the component database. This includes the graphics entities like points, lines, arcs, circles etc. and the co-ordinate points, which define the location of these entities. This geometric data is used in all downstream applications of CAD, which include finite element modeling and analysis, process planning, estimation, CNC programming, robot programming, programming of co-ordinate measuring machines, ERP system programming and simulation. In order to achieve at least a reasonably high level of integration between CAD, analysis and manufacturing operations, the component database must contain: i. Shapes of the Components (based on solid models) ii. Bill of Materials (BOM), of the assembly in which the components are used. iii. Material of the Components iv. Manufacturing, test and assembly procedures to be carried out to produce a component so that it is capable of functioning as per the requirements of design. In designing a data structure for CAD database the following factors are to be considered: i. The data must be neutral. ii. The data structure must be user-friendly. iii. The data must be portable. In order to achieve the above requirements, some type of standardization has to be followed by the CAD software designers. The basic elements associated with a CAD system are: • Operator user • Graphics Support System • Other User )nterface Support System • Application Functions • Database
  • 2. A diagrammatic presentation of these elements is given in Figure. The reasons for evolving a graphic standard thus include: • Need for exchanging graphic data between different computer systems. • Need for a clear distinction between modeling and reviewing aspects. Standards for Graphics Programming (i) GKS (Graphical Kernel System): It is an ANSI and ISO standard. GKS standardizes two dimensional graphics functionality at a relatively low level. The primary purposes of the standard are: • To provide for portability of graphics application programs. • To aid in the understanding of graphics method by application programmers. • To provide guidelines for manufacturers in describing useful graphics capabilities. The GKS (ANSI X3.124-1985) consists of three basic parts: i. An informal exposition of contents of the standard, which includes such things as positioning of text, filling of polygons etc. ii. A formalization of the expository material outlined in (i) by way of abstracting the ideas into functional descriptions (input/output parameters, effect of each function etc.). iii. Language bindings, which are the implementations of the abstract functions, described in (ii) in a specific computer language like FORTRAN, Ada or C. The features of GKS include: i. Device Independence: The standard does not assume that the input or output devices have any particular features or restrictions. ii. Text/Annotations: All text or annotations are in a natural language like English. iii. Display Management: A complete suite of display management functions, cursor control and other features are provided. iv. Graphics Functions: Graphics functions are defined in 2D or 3D. The drivers in GKS also include metafile drivers. Metafiles are devices with no graphic capability like a disc unit. The GKS always works in a rectangular window or world coordinate system. The window also defines a scaling factor used to map the created picture into the internal co-ordinate system of GKS called Normalized Device Co-Ordinates. Windows and view ports can then work in this co-ordinate system. PHIGS: P()GS Programmer’s (ierarchical )nteractive Graphics Standard includes in its functionality three dimensional output primitives and transformations. It has dynamic control over the visual appearance of attributes of primitives in a segment. The PHIGS standard defines a set of device-independent logical concepts. Application programmers can use these concepts within a set of PHIGS rules. The major concepts are the Logical Input Device, PHIGS structure, Structure Networks, Structure Manipulation, Search and
  • 3. Inquiry, Structure Traversal and Display, the Name Set mechanism, the viewing pipeline, and the PHIGS workstation. Fig. GKS Implementation in a CAD Workstation PHIGS, a programming library for 3D graphics, was developed and maintained by ISO. It is most commonly used on the X Windows system. The PHIGS high level graphics library contains over 400 functions ranging from simple line drawing to lighting and shading. Before displaying a picture, the application first stores its graphics information in the PHIGS graphic database. Therefore PHIGS is referred to as a display list system. The application then appears on one or more display devices and then passes the list to them. Exchange of CAD Data between Software Packages Necessity to translate drawings created in one drafting package to another often arises. For example you may have a CAD model created in PRO/E package and you may wish that this might be transferred to I-DEAS or Uni-Graphics. It may also be necessary to transfer geometric data from one software to another. This situation arises when you would want to carry out modeling in one software, say PRO/E and analysis in another software, say ANSYS. One method to meet this need is to write direct translators from one software to another. This means that each system developer will have to produce its own translators. This will necessitate a large number of translators. If we have three software packages we may require six translators among them. This is shown in Fig.
  • 4. Fig. Direct Data Translation A solution to this problem of direct translators is to use neutral files. These neutral files will have standard formats and software packages can have pre-processors to convert drawing data to neutral file and postprocessors to convert neutral file data to drawing file. Figure illustrates how the CAD data transfer is a accomplished using neutral file. Three types of neutral files are discussed here: i. Drawing Exchange Files (DXF) ii. IGES Files iii. STEP Files Fig. CAD Data Exchange Using Neutral Files DXF Files DXF file (Drawing Exchange File) is a popular data exchange format adopted by many CAD system vendors. DXF format is easy to interpret though it is a lengthy file. The data pertaining to the drawing entities are included in the entities section. Fig. shows a plate with a hole. Initial Graphics Exchange Specification (IGES) Graphics Standard The IGES committee was established in the year 1979. The CAD/CAM Integrated Information Network (CIIN) of Boeing served as the preliminary basis of IGES. IGES version 1.0 was released in 1980. IGES continues to undergo revisions. IGES is a popular data exchange standard today. Figure shows a CAD model of a plate with a centre hole. The wire frame model of the component is shown in Fig. There are eight vertices (marked as
  • 5. PNT 0 - PNT 8), 12 edges and two circles that form the entities of the model. Table shows the IGES output of the wire frame model. Fig. 3-D Model of a Plate Fig. Wire-frame Model of the Component IGES files can also be generated for: i. Surfaces ii. Datum curves and points Product Data Exchange Specification (PDES) A likely alternative to IGES is the Product Data Exchange Specification (PDES) developed by IGES organization. PDES is aimed at defining a more conceptual model. Parts will be based on solids and defined in terms of features such as holes, flanges, or ribs. Instead of dimensions PDES will define a tolerance envelope for the parts to be manufactured. PDES will also contain non-geometric information such as materials used, manufacturing process and suppliers. PDES will be a complete computer model of the part. Point and Line, Line Drawing Algorithms
  • 6. In the case of the computer graphics we have a digitized raster environment so xy are defined as integer coordinates and we need to actually find out what are those coordinates which fall on the line before we draw it. So that is the problem in the digitized space, we do not have continuous values of x and y like the analog world. And hence in the case we need an algorithm by which we draw a line. Display devices raster in all that we can visualize ourselves the digitized space or a raster space as the matrix or an array of pixels and definitely if we draw an arbitrary line, not all of this square pixel blocks or raster position will fall on a line. So we are talking of approximately representing line in that sense truly of course in analog environment you can say there are basically infinite points which lie on the line. That is not the case, we have a finite set of pixels which fall on a line and you have to find out which are those finite pixels. When we define a line we can think of the equation of a line or the staring point x1 y1 and the finishing point x2 y2 of a line and we can simply draw a line by a scale that is fine. But in the case of a graphic screen which we are viewing now in a TV or a CRT monitor we have to find out what are those pixels staring from x0 y0 and so on up to an end point x and y or x1 and y1. What are those points or the addressable pixels is the term used here in the problem definition which falls in this line. Given the specification of a straight line either in the form of an equation or the staring point and the end point, if that is given find the collection of addressable pixels which most closely approximates this line. The goals of line drawing algorithms: a) Straight line should appear straight. b) It should start and end accurately, matching end points with connecting lines. c) Lines should haze constant brightness. d) Lines should be drawn as rapidly as possible. Two line drawing algorithms are: a) DDA (Digital Differential Analyzer) b) Bresenham s line drawing algorithm a) DDA (Digital Differential Analyzer) 1) A line can be specified in the form: y = mx + c 2) Let m be between 0 to 1, then the slope of the line is between 0 and 45 degrees. 3) For the x-coordinate of the left end point of the line, compute the corresponding y value according to the line equation. Thus we get the left end point as (x1, y1), where y1 may not be an integer. 4) Calculate the distance of (x1, y1) from the center of the pixel immediately above it and call it D1 5) Calculate the distance of (x1, y1) from the center of the pixel immediately below it and call it D2 6) If D1 is smaller than D2, it means that the line is closer to the upper pixel than the lower pixel, then, we set the upper pixel to on; otherwise we set the lower pixel to on. 7) Then increment x by 1 and repeat the same process until x reaches the right end point of the line. 8) This method assumes the width of the line to be zero.
  • 7. DDA Algorithm: 1. Define the nodes, i.e end points in form of (x1, y1) and (x2, y2). 2. Calculate the distance between the two end points vertically and horizontally, i.e dx = |x1- x2| and dy =|y1 - y2|. 3. Define new variable name pixel , and compare dx and dy values, if dx > dy then pixel = dx else pixel = dy. 4. dx = dx/pixel; and dy = dy/pixel 5. x = x1; y = y1; 6. while (i <= pixel) compute the pixel and plot the pixel with x = x + dx and y = y + dy. b) Bresenham's Line Algorithm 1. Input the two line endpoints and store the left endpoint in (xo, yo) 2. Load (xo, yd) into the frame buffer; that is, plot the first point. 3. Calculate constants Δx, Δy, 2Δy, and 2Δy – 2Δx, and obtain the starting value for the decision parameter as po = 2Δy - Δx 4. At each xk along the line, starting at k = 0, perform the following test: If pk < 0, the next point to plot is (xk+1, yk) and pk+1 = pk - 2Δy Otherwise, the next point to plot is (xk+1, yk+1) and pk+1 = pk + 2Δy - 2Δx 5. Repeat step 4 Δx times. Mid Point Circle Algorithm 1) Input radius r and circle center (x, y,), and obtain the first point on the circumference of a circle centered on the origin as (x0, y0) = (0, r) 2) Calculate the initial value of the decision parameter as p0 = 54 – r 3) At each xk position, starting at k = 0, perform the following test: If pk < 0, the next point along the circle centered on (0,0) is (xk+1, yk) and pk+1 = pk +2xk+1+1 Otherwise, the nest point along the circle is (xk+1, yk+1) and pk+1 = pk+2xk+1 + 1 - 2yk+1 where 2xk+1= 2xk + 2 and 2yk+1= 2yk - 2. 4. Determine symmetry points in the other seven octants. 5. Move each calculated pixel position (x, y) onto the circular path centered on (xc, yc) and plot the coordinate values: x = x + xc, y = y + yc
  • 8. 6. Repeat steps 3 through 5 until x >= y. Basic Transformation Animations are produced by moving the 'camera' or the objects in a scene along animation paths. Changes in orientation, size and shape are accomplished with geometric transformations that alter the coordinate descriptions of the objects. The basic geometric transformations are translation, rotation, and scaling. Other transformations that are often applied to objects include reflection and shear. Use of Transformation in CAD In mathematics, "Transformation" is the elementary term used for a variety of operation such as rotation, translation, scaling, reflection, shearing etc. CAD is used throughout the engineering process from conceptual design and layout, through detailed engineering and analysis of components to definition of manufacturing methods. Every aspect of modeling in CAD is dependent on the transformation to view model from different directions we need to perform rotation operation. To move an object to a different location translation operation is done. Similarly Scaling operation is done to resize the object. Coordinate Systems In CAD three types of coordinate systems are needed in order to input, store and display model geometry and graphics. These are the Model Coordinate System (MCS), the World Coordinate System (WCS) and the Screen Coordinate System (SCS). 1. Model Coordinate System (MCS): The MCS is defined as the reference space of the model with respect to which all the model geometrical data is stored. The origin of MCS can be arbitrary chosen by the user. 2. World Coordinate System (WCS) Every object has its own MCS relative to which its geometrical data is stored. Incase of multiple objects in the same working space then there is need of a World Coordinate System which relates each MCS to each other with respect to the orientation of the WCS. 3. Screen Coordinate System (SCS) In contrast to the MCS and WCS the Screen Coordinate System is defined as a two dimensional device- dependent coordinate system whose origin is usually located at the lower left corner of the graphics display as shown in the picture below. A transformation operation from MCS coordinates to SCS coordinates is performed by the software before displaying the model views and graphics.
  • 9. Viewing Transformations As discussed that the objects are modeled in WCS, before these object descriptions can be projected to the view plane, they must be transferred to viewing coordinate system. The view plane or the projection plane is set up perpendicular to the viewing zv axis. The World coordinate positions in the scene are transformed to viewing coordinates, and then viewing coordinates are projected onto the view plane. The transformation sequence to align WCS with Viewing Coordinate System is. 1. Translate the view reference point to the origin of the world coordinate system. 2. Apply rotations to align xv, yv, and zv with the world xw, yw and zw axes, respectively. Translation A translation is applied to an object by repositioning it along a straight line path from one coordinate location to another. We translate a two-dimensional point by adding translation distances, tx and ty, to the original coordinate position (x,y) to move the point to a new position (x',y') ′ = + ′ = + The translation distance pair (tx, ty) is called translation vector or shift vector. �� � � � � � � , [ ′ ′ ] = [ ] + [ + ] This allows us to write the two-dimensional translation equations in the matrix form: �′ = � + Rotation A two-dimensional rotation is applied to an object by repositioning it along a circular path in the x-y plane. When we generate a rotation we get a rotation angle θ and the position about which the object is rotated (xr ,yr) this is known as rotation point or pivot point. The transformation can also be described as a rotation about rotation axis that is perpendicular to x-y plane and passes through the pivot point. Positive values for the rotation angle define counter-clockwise rotations about the pivot point and the negative values rotate objects in the clockwise direction. Suppose the pivot point be at origin, to understand the relationship between angular and coordinate points of original and transformed position r - Constant distance of the point from the origin; Φ - Original angular position of the point from the horizontal; θ - Rotation angle We can express the transformation by the following equations ′ = �� � + � ′ = � � � + � We know the coordinate of x and y in polar form ′ = �� � ′ = � � � on expanding and equating we get ′ = � � − � � ; ′ = � � − � �
  • 10. The same equations we can write in matrix form as �′ = �. Where the rotation matrix R is = [ � � � � − � � � � ] Hence it is [ ′ ′] = [ ] [ � � � � − � � � � ] Scaling Scaling is a kind of transformation in which the size of an object is changed. Remember the change in size does not mean any change in shape. This kind of transformation can be carried out for polygons by multiplying each coordinate of the polygon by the scaling factor. Sx and Sy which in turn produces new coordinate of (x,y) as (x',y'). The equation would look like [ ′ ′ ] = [ ] [ ] �′ = �. here S represents the scaling matrix. Note: If the values of scaling factor are greater than 1 then the object is enlarged and if it is less that 1 it reduces the size of the object. Keeping value as 1 does not changes the object. Uniform Scaling: To achieve uniform scaling the values of scaling factor must be kept equal. Differential Scaling: Unequal or Differential scaling is produce incases when values for scaling factor are not equal. As per usual phenomenon of scaling, an object moves closer to origin when the values of scaling factor are less than 1. To prevent object from moving or changing its position while is scaling we can use a point that is would be fixed to its position while scaling which is commonly referred as fixed point (xf ,yf). Reflection Reflection is nothing more than a rotation of the object by 180o. In case of reflection the image formed is on the opposite side of the reflective medium with the same size. Therefore we use the identity matrix with positive and negative signs according to the situation respectively. The reflection about the x-axis can be shown as: = [ − ] The reflection about the y-axis can be shown as: = [ − ]
  • 11. Reflection about an Origin: When both the x and y coordinates are flipped then the reflection produced is relative to an axis that is perpendicular to x-y plane and that passes through the coordinate origin. This transformation is referred as a reflection relative to coordinate origin and can be represented using the matrix below. = [ − − ] Reflection about an Arbitrary Line: Reflection about any line y = mx + c can be accomplished with a combination of translate-rotate-reflect transformations. Steps are as follows: 1. Translate the working coordinate system (WCS) so that the line passes through the origin. 2. Rotate the WCS such that one of the coordinate axes lies onto the line. 3. Reflect about the aligned axis 4. Restore the WCS back by using the inverse rotation and translation transformation. Homogeneous Coordinates We have seen that basic transformations can be expressed in matrix form. But many graphic applications involve sequences of geometric transformations. Hence we need a general form of matrix to represent such transformations. This can be expressed as: �′ = �. + Where P and P' - represent the row vectors. T1 - is a 2 by 2 array containing multiplicative factors. T2 - is a 2 element row matrix containing translation terms. We can combine multiplicative and translational terms for 2D geometric transformations into a single matrix representation by expanding the 2 by 2 matrix representations to 3 by 3 matrices. This allows us to express all transformation equations as matrix multiplications, providing that we also expand the matrix representations for coordinate positions. To express any 2D transformations as a matrix multiplication, we represent each Cartesian coordinate position (x,y) with the homogeneous coordinate triple (xh,yh,h),such that [ �] = [ � �⁄⁄ ] = [ � �⁄⁄ ] Thus, a general homogeneous coordinate representation can also be written as (h.x, h.y, h). For 2D geometric transformations, we can choose the homogeneous parameter h to any non-zero value. Thus, there is an infinite number of equivalent homogeneous representations for each coordinate point (x,y). A convenient choice is simply to h = 1. Each 2D position is then represented with homogeneous coordinates (x, y, 1). Other values for parameter h are needed, for eg, in matrix formulations of 3D viewing transformations. Expressing positions in homogeneous coordinates allows us to represent all geometric
  • 12. transformation equations as matrix multiplications. Coordinates are represented with three element row vectors and transformation operations are written as 3 by 3 matrices. � � � � � � � , [ ′ ′ ] = [ ]. [ ] or �′ = �. , � � � � � � , [ ′ ′ ] = [ ]. [ � � � � − � � � � ] or �′ = �. � �� � � � � , [ ′ ′ ] = [ ]. [ ] or �′ = �. , 2D Composite Transformation With the matrix representations of the transformations, we can set up a matrix for any sequence of transformations as a composite transformation matrix by calculating the matrix product of the individual transformations. If two successive transformations T1 and T2 are applied to a coordinate position P, the final transformed location P' is calculated as: �. = � . = � Where = . ) 1. Translation In translation, an object is displayed a given distance and direction from its original position. If the displacement is given by the vector = ̂ + ̂ the new object point P'(x',y') can be found by applying the transformation Tv to P(x,y) �′ = � where ′ = + and ′ = + = ( ) [ ] ; = [ ] = + + [ + + ]
  • 13. 2. Rotation A generalized rotation about an arbitrary point (a, b) can be obtained by performing the following transformations: 1. Translate the object so that the pivot-point position is moved to coordinate origin. 2. Rotate the object about the coordinate origin. 3. Translate the object so that the pivot point is returned to its original position. 4. The composite matrix for this sequence is obtained as: = . . = [ − − ] = [ � � � � − � � � � ] = [ ] = [ � � � � − � � � � − � � + � � − � � − � � ] 3. Scaling The animation illustrates a transformation sequence to produce scaling with respect to a selected fixed position (a,b) using a scaling function that can only scale relative to the coordinate origin. 1. Translate object so that the fixed point coincides with the coordinate origin. 2. Scale the object with respect to the coordinate origin. 3. Use the inverse translation of step 1 to return the object to its original position. 4. The composite matrix for this sequence is obtained as: = . . Where, = [ − – ] = [ ] = [ ] = [ − ( − ) ] 3D- Transformations 1. Translation: In three-dimensional homogeneous coordinate representation, when a point P is translated to P' with coordinated (x, y, z) and x', y’, z’ can be represented in matrix form as: P’ = P.T Where, P = [x y z]; P’ = [x’ y’ z’]; X’ = X + TX ; y’ = y + Ty ; z’ = z + Tz
  • 14. = [ ] 2. Rotation Unlike 2D, rotation in 3D is carried out around any line. The most simple rotations could be around coordinate axis. As in 2D positive rotations produce counter-clockwise rotations. Rotation in term of general equation is expressed as P’ = P.R θ) Where, P = [x y z]; P’ = [x’ y’ z’] R = Rotation Matrix Rotation matrix when an object is rotated about X axis can be expressed as: = [ � � � � − � � � � ] Rotation matrix when an object is rotated about Y axis can be expressed as: = [ � � − � � � � � � ] Rotation matrix when an object is rotated about Z axis can be expressed as: = [ � � � � − � � � � ] 3. Scaling Scaling an object in three-dimensional is similar to scaling an object in two-dimensional. Similar to 2D scaling an object tends to change its size and repositions the object relative to the coordinate origin. If the transformation parameters are unequal it leads to deformation of the object by changing its dimensions. The perform uniform scaling the scaling factors should be kept equal i.e. Sx = Sy = Sz ; P’ = P.S Where, P = [x y z]; P’ = [x’ y’ z’] = [ ]
  • 15. Note: A special case of scaling can be represented as reflection. If the value of Sx, Sy or Sz be replaced by -1 it will return the reflection of the object against the standard plane whose normal would be either x axis, y axis or z axis respectively. 4. Reflection In 3D-reflection the reflection takes place about a plane whereas 2D reflection it used take place about an axis. The matrix in case of pure reflections, along basic planes, viz. X-Y plane, Y-Z plane and Z-X plane are given below: Transformation matrix for a reflection through X-Y plane is: = [ − ] Transformation matrix for a reflection through Y-Z plane is: = [ − ] Transformation matrix for a reflection through Z-X plane is: = [ − ] General 3-D Rotation Rotation in three dimensions is more complex than the rotation in two dimensions. Three dimensional rotations require the prescription of an angle of rotation and an axis of rotation. The canonical rotations are defined when one of the positive x, y, z coordinate axis is chosen as the axis of rotation. Then the construction of rotation transformation proceeds just like that of a rotation in two dimensions about the origin. Steps to be Performed: 1. Translate origin to A1 = [ ] 2. Align vector with axis (say, z) Rotate to bring vector in yz plane = [ � � − � � � � � � ] Rotate to bring vector along z-axis
  • 16. = [ � � � � − � � � � ] 3. Rotate line P1P2 about z-axis which is already aligned with the Rotation axis. 4. Reverse steps 2 5. Reverse step 1 Representing All Transformations as Matrix Multiplications Two Dimensional coordinates are represented using three-element column vectors, and Transformation operation is represented by 3 x 3 matrices. [x’ y’ z’ ] = [x y z].[ ] which can be written in abbreviated form as P’ = P.T tx , ty) Capturing Composite Transformations Conveniently On the basis of the matrix product of the individual transformations we can set up a matrix for any sequence of transformation known as composite transformation matrix. For row-matrix representation we form composite transformations by multiplying matrices in order from left to right whereas in column-matrix representation we form composite transformations by multiplying matrices in order from right to left. Non Linear Transformations (3D -Perspective Transformations) Standard Perspective Projection: A Perspective Transformation is the transformation from one three space in to another three space. In contrast to the Parallel Transformation, in perspective transformations parallel lines converge, object size is reduced with increasing distance from the center of projection, and non uniform foreshortening of lines in the object as a function of orientation and the distance of the object from the center of projection occurs. All of these effects laid the depth perception of the human visual system, but the shape of the object is not preserved. Perspective Drawings are characterized by Perspective Foreshortening and Vanishing Points. Perspective Foreshortening is the illusion that object and lengths appear smaller as there distance from the center of projection increases. The illusion that certain sets of parallel lines appear to meet at a point is another feature of perspective drawings. These points are called Vanishing Points .Principal vanishing points are formed by the apparent intersection of lines parallel to one of the three x,y or z axis. The number of principal vanishing points is determined by the number of principal axes interested by the view plane. Perspective Anomalies 1. Perspective Foreshortening: The farther an object is from the center of projection, the smaller it appears.
  • 17. 2. Vanishing Points: Projections of lines that are not parallel to the view plane (i.e. lines that are not perpendicular to the view plane normal) appear to meet at some point on the view plane. This point is called the vanishing point. A vanishing point corresponds to every set of parallel lines. Vanishing points corresponding to the three principle directions are referred to as "Principle Vanishing Points (PVPs)". We can thus have at most three PVPs. If one or more of these are at infinity (that is parallel lines in that direction continue to appear parallel on the projection plane), we get 1 or 2 PVP perspective projection. Transformation Matrix for Standard Perspective Projection View plane at = ; ′ = − ; ′ = − ; ′ = − ( − � ) ∗ ′ = [ ] − ∗ [ − − ( − � )] = − − � ′ = ∗ − = ∗ � − − � ′ = − − � �imilarl� ′ = − − � ; ′ = = [ − − � � ] Transforming a Point or Transforming the Axis Graphics applications often require transformation of objects description form one coordinate system to another. The process of transformation involves steps like translation and rotation. This transformation can be done in two different ways either by transforming a point of the object or by transforming the axis to a
  • 18. point on object. Both of these methods are literally as well as mathematically opposite to each other. For example the matrix for translating point P(x, y, z) to origin the matrix would be exactly the mathematical inverse of the matrix for translating Origin to point P. �ran�la�ion ma�ri� �o �ran�la�� poin� � �o ori�in, = [ − − ] �ran�la�ion ma�ri� �o �ran�la�� ori�in �o poin� � , = [ ] This is true for rotation matrix also. How to Determine the Angle of Rotation? In various situations for performing complex transformations first we need to align an arbitrary line with the standard axis. To align the standard axis with an arbitrary line it is important to know the angle of rotations. As show in the figure above the angle θ2 is the angle for rotation about x axis so as to align z axis with the projection of A1A2 on YZ plane. Thereafter with the same position of z axis rotation of θ2 is taken about Y axis which aligns the Z axis with the arbitrary line. The angles can be calculated as below. � = � − √ + √ + + ; � = � − ( √ + ) Representing Points at Infinity Homogeneous coordinates can be used to display a point at infinity. For example [ ] = [ ] In the above example the point at infinity is presented in the form of homogeneous coordinates. This is often needed when we want to represent a point at infinity in a certain direction. For instance, for finding the vanishing point in perspective projections we can transform the point at infinity in the given direction.
  • 19. General 3-D Reflection Some orientations of a three dimensional object cannot be obtained using pure rotations; they require reflections. In three dimensions, reflection occurs through a plane. By analogy with the previous discussion of two dimensional reflection three dimensional reflections through a plane is equivalent to rotation about an axis in three dimensional spaces out in to four dimensional space and back into three dimensional spaces. For pure reflection the determinant of the reflection matrix is identically -1 Steps to Be Performed: 1. Translate origin to A1 = [ ] 2. Align vector with axis (say, z) Rotate to bring vector in yz plane = [ � � − � � � � � � ] 3. Rotate to bring vector along z-axis = [ � � � � − � � � � ] 4. Reflect the line P1P2 through the standard y-z plane. 5. Reverse steps 2 6. Reverse step 1 Orthographic Projection The simplest of the Parallel projections is the orthographic projection, commonly used for engineering drawings. They accurately show the correct or true size and shape of single plane face of an object. Orthographic projections are projections onto one of the coordinate planes x = 0, y = 0, z = 0.The matrix for projection onto the z plane is � = [ ] Notice that the third column (the z column) is all zeros. Consequently, the effect of the transformation is to set the z coordinate of a position vector to zero. Similarly, the matrices for projection on to x = 0 and y = 0 planes are:
  • 20. � = [ ] an� � = [ ] Axonometric Projection A single orthographic projection fails to illustrate the general three-dimensional shape of an object. Axonometric projections overcome this limitation. An axonometric projection is constructed by manipulating the object using rotations and translations, such that at least three adjacent faces are shown. The result is then projected from the center of projection at infinity on to one of the coordinate plane unless a face is parallel to the plane of projection, an axonometric projection does not show its true shape. However, the relative lengths of originally parallel lines remain constant, i.e., parallel lines are equally foreshortened. Foreshortening Factor It is the ratio of the projected length of a line to its true length. Types of axonometric projections: 1. Trimetric 2. Dimetric 3. Isometric Trimetric projection is the least restrictive and isometric projection is the most restrictive. Trimetric Projection A trimetric projection is formed by arbitrary rotations in arbitrary order, about any or all of the coordinate axes, followed by parallel projection on to the z = 0 plane. The wide variety of trimetric projections precludes giving a general equation for these ratios. For any specific trimetric projection, the foreshortening ratios are obtained by applying transformation matrix to the unit vector along the principal axis specifically, [ ][ ] = [ ] [ ] = [ ∗ ∗ ∗ ∗ ∗ ∗ ] where [U] is the matrix of unit vectors along the untransformed x, y and z axes respectively, and [T] is the concatenated trimetric projection matrix. The foreshortening factors along the projected principal axes are then � = √ ∗ + ∗ ; � = √ ∗ + ∗ ; � = √ ∗ + ∗ Oblique Projection: Oblique projections illustrate the general 3 dimensional shape of the object. However only faces of the object parallel to the plane of projection are shown at there true size and shape that is angles and lengths are preserved for these faces only. In fact, the oblique projection of these faces is equivalent to an orthographic front view.
  • 21. Types of Oblique Projections 1. Cavalier 2. Cabinet Cavalier Projection A cavalier projection is obtained when the angle between oblique projectors and the plane of projection is 450 degree. In a cavalier projection the foreshortening factors for all three principal directions are equal. The resulting figure appears too thick. A cabinet projection is used to correct this deficiency. Cabinet Projection An oblique projection for which the foreshortening factor for edges perpendicular to the plane of projection is one half is called a Cabinet Projection.