Sei sulla pagina 1di 33

UNI T 2: P age | 1

ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY


BY MANU GUPTA-09352601453- manukota1@gmail.com










Computer graphics

By
Manu Gupta


UNIT 2


























UNI T 2: P age | 2
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com












































UNI T 2: P age | 3
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

CONTENTS


1.1- What is computer graphics
1.2- Interactive Computer Graphics
1.3- Representations in graphics
Vector Graphics
Raster Graphics
1.4- Graphical Input Techniques
1.5- Need for input techniques:
1.6- Introduction:
a. Positioning Techniques
b. Positioning constraint
c. Rubber band techniques
d. Dragging
e. Selection of Objects
f. Menu selection

2.1- Understanding Of Graphic Representation:
2.2- Coordinate Systems
2.3- Object Space
2.4- Homogeneous Coordinates
2.5- World Space
2.6- View Port
2.7- Orthographic Projection
2.8- Perspective Projection
2.9- Procedure For Perspective Projection In 3d









UNI T 2: P age | 4
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

3. Transformation: 2-D TRANSFORMATIONS

3.1- Introduction
3.2- What is transformation?
3.3- The basic Transformation
3.4- Deformable transformations
3.5- Other classification of transformation:
3.6- Matrix representations of points
3.7- Review of matrix operations
3.8- Different transformation procedures
a. Translation
b. Scale
c. Mirror
d. Rotation
e. Window-Viewport Mapping
f. Combining Transformations



















UNI T 2: P age | 5
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

1.1- What is computer graphics

Computer graphics are graphics created using computers and, more generally, the representation and
manipulation of image data by a computer with help from specialized software and hardware.

1.2- Interactive Computer Graphics

1.3- Representations in graphics
Vector Graphics
Image is represented by continuous geometric objects: lines, curves, etc.
Graphics objects: geometry + colour
Complexity ~ low(number of objects)
Geometric transformation possible without loss of information (zoom, rotate, )
Diagrams, schemes, ...
Examples: PowerPoint, CorelDraw, ...
Raster Graphics
Image is represented as an rectangular grid of coloured squares
Generic
Image processing techniques
Geometric Transformation: loss of information
Complexity ~high(number of pixels)
J agged edges, anti-aliasing
Realistic images, textures, ...
Examples: Paint, PhotoShop, ...

UNI T 2: P age | 6
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com


Conversion Procedure




1.4- Graphical Input Techniques

1.5- Need for input techniques:
We have familiarized ourselves with many of the interactive input devices. But since the
computer expects perfect input values, any errors made in the use of such devices can create
problems
- Like not drawing the lines completely on the tablet or overdrawing it. Similarly,
-The end points of lines may not appear exactly on a pixel value.
Hence, several techniques are available that can cover up for the deficiencies of the input and still
make the computer work satisfactorily.

1.6- Introduction:

We have seen several input devices, which bear resemblance to pens and pencils example light pens,
joysticks etc. To some extent they are intentionally made to resemble the device that the user is
familiar with.
However, there is a basic difference between the targets of such inputs i.e. a material written
with a pen are targeted towards the human user, while the graphical input derives are targeted
towards the computer.
The difference-The human can understand variations of input to a large extent.
For example the letter A may be written in different ways by different people, similarly while
drawing a circle, if the two ends do not meet properly, a human being can still consider it as a
circle, whereas a computer may not. In other words, the input to human can vary over a range,
while the inputs to a computer need to be precise.
The solution: The very simple concept of cursor is a good example of input technique. It can
be thought of as a feedback technique. It indicates the present position of editing / operation.
In a more sophisticated case, it can be a block of the text / figure selected by blocking. It
helps the user to know what he is doing and in fact, ascertains that the function that he is
working on is actually working.





UNI T 2: P age | 7
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

a. Positioning Techniques
This can be considered the most basic of graphical input operations. In its simplest form, it
involves choosing a symbol / character on the screen and moving it to another location. One
way of using it is to choose the symbol or picture involved, moving the cursor to the position
required and pressing a (predetermined) key to place in that position.

1. Choose object
2. Choose location
3. End

b. Positioning constraint

One of the problems faced by inexperienced users while drawing figures is the concept of positioning. For
example, we may want to put an object exactly at the end of a straight-line.


Because of lack of coordination between the eyes and the hand movements, the object may end up either a little
away from the line or inside the line as below. So it may be possible we end up like case 1 or case 2.
(i). One of the methods of helping the user is to put a construct on the position of the box. i.e. when the
distance between the box and the end of the line is very small, the box automatically aligns itself on the edge of
the line. i.e. it is enough if the user brings it to either of the positions (ii) & (iii) and the software automatically
aligns it to position (i).



it is easy to note that writing an algorithm for this is fairly straight forward. Assuming each line ends at an integer
value of the pixel, if the edge of the base is brought to a value which is a fraction above / below the value,
automatically round it off to the pixel value. For example, if the (x,y) values of the end of the lines is say (10,50)
and a box is brought to a position say (10.6,50.7), the values are automatically changed to (10,50), similar being
the case if the box position is say (9.7, 49.8).

c. Rubber band techniques

Rubber banding is a very simple, but useful technique for positioning. The user, if he wants to draw a line, say,
specifies the end points and as he moves from one point to another, the program displays the line being drawn.
The effect is similar to an elastic line being stretched from one point to another and hence the name for the
technique. By altering the end points, the position of the line can be modified.
The technique can be extended to draw rectangles, arcs, circles etc. The technique is very useful when figures
that pass through several intermediate points are to be drawn.
Hence, the positioning can be done dynamically; however, rubber band techniques normally demand fairly
powerful local processing to ensure that lines are drawn fast enough.

UNI T 2: P age | 8
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

d. Dragging

As the name suggests, it involves choosing a symbol or a portion of a figure and positioning it at any desired
point. It is possible to achieve a accurate and visible results without bothering to know about the actual
coordinates involved.


e. Selection of Objects

One of the important points to be addressed is to select parts of the picture for further operations. Once the
selection is made properly, tasks like moving, deletion, copying is whatever can be done. But the actual selection
process poses several problems.
The first one is about the choice of coordinates. When a point is randomly chosen at the
starting point of the selection process, the system should be able to properly identify its coordinates. The second
problem is about how much is being selected. This can be indicated by selecting a number of points around the
figure or by enclosing the portion selected by a rectangle. The other method is to use multiple keys i.e. position
the cursor at the first point of selection, press certain combination of keys, move the cursor to the final position
and again press certain combination of keys, so that the figure lying in between them is selected. The mouse
facilitates the same operation by the use of multiple buttons on it. Once the selection is made, normally the
system is supposed to display the portion selected so that user can know he has actually selected what he had
wanted to. This feedback is done either by changing the color of the screen, modifying the brightness or by
blinking.


f. Menu selection

This is one of the special cases of selection where the user would be able to choose and operate from a set of
available commands / figures displayed on the screen. This concept is called the menu operation, where you
select the item from those available on the menu card. The use of mouse an input technique normally implies
menus being provided by the system. The menu concept helps the user to overcome the difficulty of having to
draw simple and often used objects by providing them as a part of the system.
Example: Like using model tree in Pro e to select any feature.





















UNI T 2: P age | 9
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

Example Selecting objects In Autocad:
To modify the drawing you need to know how to select objects.
AutoCAD provides you with three ways of selecting an object:
step 1: Click (Individual selection):
Also called Pick box Selection, this method will allow you to select an individual
objects, you simply click on the object with your mouse. You can continue
selecting additional objects as needed with ctrl, each object selected will change
appearance to dashed lines.
step 1: Click and drag (Window Selection):
Will allow you to select several objects at the same time. To make a
window selection, you need to specify opposite corners, from Pt1 to Pt2
(left to right), that define a window area.
Only objects that are entirely within the window area are selected and
change to dashed lines. If any part of an object is outside the window, is
not selected.

step 2: Cross Window Selection:
You need to specify opposite corners, from P1 to P2 (but from right to
left), any objects that are inside or touched by the crossing window are
selected as shown by dashed objects.






UNI T 2: P age | 10
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com




Review Question:

Name the type of input facility available to the user in each of the following cases
1. Moving pictures from one place to another.
2. Making a line meet another box accurately.
3. Ending a line exactly a pixel.
4. Drawing a straight line interactively
5. Showing the x, y coordinates of points as the lines are being drawn.
6. Choosing one out of a number of options.

Answers:
2. Dragging
3. gravitational constraint
4. Modular constraint
5. Rubber band technique
6. Dimensioning technique.
7. Menu selection

























UNI T 2: P age | 11
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com


3. Understanding of graphic representation:

Before transformation it is important to understand representation of model in different coordinate systems.
4. Coordinate Systems

The purpose of the graphics pipeline is to create images and display them on your screen. The graphics
pipeline takes geometric data representing an object or scene (typically in three dimensions) and creates a
two-dimensional image from it. Your application supplies the geometric data as a collection of vertices that
form polygons, lines, and points. The resulting image typically represents what an observer or camera
would see from a particular vantage point.
As the geometric data flows through the pipeline, the GPU's vertex processor transforms the constituent
vertices into one or more different coordinate systems, each of which serves a particular purpose. Cg
vertex programs provide a way for you to program these transformations yourself.
Vertex programs may perform other tasks, such as lighting and, but transforming vertex positions is a task
required by all vertex programs. You cannot write a vertex program that does not output a transformed
position, because the rasterizer needs transformed positions in order to assemble primitives and generate
fragments.
So far, the vertex program examples you've encountered limited their position processing to simple 2D
transformations. This chapter explains how to implement conventional 3D transformations to render 3D
objects.
Figure illustrates the conventional arrangement of transforms used to process vertex positions. The
diagram annotates the transitions between each transform with the coordinate space used for vertex
positions as the positions pass from one transform to the next.









UNI T 2: P age | 12
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

5. Object Space
Applications specify vertex positions in a coordinate system known as object space (also called model
space). When an artist creates a 3D model of an object, the artist selects a convenient orientation, scale,
and position with which to place the model's constituent vertices. The object space for one object may have
no relationship to the object space of another object. For example, a cylinder may have an object-space
coordinate system in which the origin lies at the center of the base and the z direction points along the axis
of symmetry.
You represent each vertex position, whether in object space or in one of the subsequent spaces, as a vector.
Typically, your application maintains each object-space 3D vertex position as an <x, y, z>vector. Each
vertex may also have an accompanying object-space surface normal, also stored as an <x, y, z>vector.

6. Homogeneous Coordinates
More generally, we consider the <x, y, z>position vector to be merely a special case of the four-
component <x, y, z, w>form. This type of four-component position vector is called a homogeneous
position. When we express a vector position as an <x, y, z>quantity, we assume that there is an implicit 1
for its w component.
Mathematically, the w value is the value by which you would divide the x, y, and z components to obtain
the conventional 3D (nonhomogeneous) position, as shown in Equation.
(
x
w
,
y
w
,
z
w
,1) (x,y,z,w)
Expressing positions in this homogeneous form has many advantages. For one,
multiple transformations, including projective transformations required for
perspective 3D views, can be combined efficiently into a single 4x4 matrix. This
technique is explained in Section 4.2. Also, using homogeneous positions makes it
unnecessary to perform expensive intermediate divisions and to create special cases
involving perspective views. Homogeneous positions are also handy for representing
directions and curved surfaces described by rational polynomials.
We will return to the w component when discussing the projection transform.
7. World Space
Object space for a particular object gives it no spatial relationship with respect to
other objects. The purpose of world space is to provide some absolute reference for
all the objects in your scene. How a world-space coordinate system is established is
arbitrary. For example, you may decide that the origin of world space is the center
of your room. Objects in the room are then positioned relative to the center of the
room and some notion of scale (Is a unit of distance a foot or a meter?) and some
notion of orientation (Does the positive y-axis point "up"? Is north in the direction of
the positive x-axis?).
8. VIEW PORT

It may be sometimes desirable to display different portions or views of the drawing in different regions of
the screen. A portion of the screen where the contents of the window are displayed is called a view port.
Let the screen size be X =0 to 200 and Y =0 to 130. A view port can be defined by the co-ordinates say
X1 =65, X2 =130, Y1 =50 and Y2 =100.
If we use the same window as in Fig 1., the definition of this view port will display the image in the right
hand top quarter of the screen (Fig.2) choosing different view ports multiple views can be placed on the
screen. Fig.3 shows four views of a component displayed using view port commands.
UNI T 2: P age | 13
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com


Fig.1 Fig.2 Fig.3



3D projection
3D projection is any method of mapping three-dimensional points to a two-dimensional plane. As most
current methods for displaying graphical data are based on planar two-dimensional media, the use of this
type of projection is widespread, especially in computer graphics, engineering and drafting.

9. Orthographic projection
When the human eye looks at a scene, objects in the distance appear smaller than objects close by.
Orthographic projection ignores this effect to allow the creation of to-scale drawings for construction and
engineering.
Orthographic projections
are a small set of transforms often used to show profile, detail or precise measurements of a three
dimensional object. Common names for orthographic projections include plane, cross-section, bird's-eye,
and elevation.
If the normal of the viewing plane (the camera direction) is parallel to one of the primary axes (which is
the x, y, or z axis), the mathematical transformation is as follows; To project the 3D point , , onto
the 2D point , using an orthographic projection parallel to the y axis (profile view), the following
equations can be used:


where the vector s is an arbitrary scale factor, and c is an arbitrary offset. These constants are optional, and
can be used to properly align the viewport. Using matrix multiplication, the equations become:
.
While orthographically projected images represent the three dimensional nature of the object projected,
they do not represent the object as it would be recorded photographically or perceived by a viewer
observing it directly. In particular, parallel lengths at all points in an orthographically projected image are
of the same scale regardless of whether they are far away or near to the virtual viewer. As a result, lengths
near to the viewer are not foreshortened as they would be in a perspective projection.


UNI T 2: P age | 14
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

10. Perspective projection
When the human eye views a scene, objects in the distance appear smaller than objects close by - this is
known as perspective. While orthographic projection ignores this effect to allow accurate measurements,
perspective definition shows distant objects as smaller to provide additional realism.
The perspective projection requires a more involved definition as compared to orthographic projections. A
conceptual aid to understanding the mechanics of this projection treating the 2D projection as being
viewed through a camera viewfinder. The camera's position, orientation, and field of view control the
behavior of the projection transformation. The following variables are defined to describe this
transformation:
11. Procedure for perspective projection in 3D
At the outset itself, it is to be made clear that since we are using a 2dimensional screen for a 3dimensional
display, what we can achieve is only an approximation. Even this approximation is achieved at the cost of
computational overheads i.e. additional computation is to be done before a picture can be fitted into a 2D
screen. Further there is a limit to the amount of computations that can be done. This limit is not set so
much by the hardware / software capacities of the machine as by the available time. Going through some
of the applications that need 3dimensional views, it is clear that the effects are to be achieved within
reasonable time. In an animation picture, if time delays prevent a continuous stream of pictures being
presented to the viewer, then the whole idea behind animation is lost. In case of simulation, the limitations
are more stringent. The views are to be presented to the viewer as they happen in the real world. If a
plane is moving (or its motion is being simulated), then the movement of hills, buildings etc should be
presented at the same speed as it is experienced in a real case. Otherwise, the entire meaning of simulation
is lost.



























UNI T 2: P age | 15
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

How can we achieve these effects?

1. Linear perspective:

2. AERIAL PERSPECTIVE OR ATMOSPHERIC PERSPECTIVE
The bluing of background is called aerial perspective. These techniques have been used in
painting, and here 3Dmodeling, animation works to give the impression of depth.



UNI T 2: P age | 16
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

3. DETAIL AND PATTERN PERSPECTIVE :-
details, pattern,and texture are sharp when near and become fuzzy further away. We can use this
property to increase sence of depth.
4. COLOUR AND VALUE PERSPECTIVE :-
Values and colour are bright and clear when they are closer and become grayer, weaker as their
distance from observer increaser.






























UNI T 2: P age | 17
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

3. TRANSFORMATION

Co-Ordinate System Used in Graphics and Windowing
Transformations can be carried out either in 2-dimensions or in 3-dimensions. The theory of two-dimen-
sional transformations is discussed first in this chapter. This is then extended to three dimensions.
When a 2-
D drafting package is initiated, the display will have a set of co-ordinate values. These are called default co-ordinates.
These may have different values in different packages. In some cases, the values will range from X =ato 12 and Y =
ato 10. In another package X may range from ato 130 and Y may range from ato 100. A world co-ordinate system is
one which the designer can specify his own co-ordinates for a specific modelling application. These screen
independent co-ordinates can have large or small numeric range, or even negative values, so that the image can be
represented in a natural way. It may, however, happen that the picture is too crowded with several features to be
viewed clearly on the display screen. Therefore, the designer may want to view only a portion of the image, enclosed
in a rectangular region called a window. Different parts of the drawing can thus be selected for viewing by placing
the windows. Portions inside the window can be enlarged, reduced or edited depending upon the requirements. Figure
5.1 shows the use of windowing to enlarge the picture.
UNI T 2: P age | 18
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

Viewport
It may be sometimes desirable to display different portions or views of the drawing in different regions of
the screen. A rectangular portion of the screen where the contents of the window are displayed is called a viewport.
Let the screen size be X =0 to 130 and Y =0 to 100. A viewport can be defined by the co-ordinates say Xl =65. X2 =
130, Y1 =50 and Y2 =100. If we use the same window as in Fig. 5.1, the definition of this viewport will display the
image in the righthand top quarter of the screen (Fig.) choosing different viewports multiple views can be placed on
the screen. Figure 5.3 shows four views of a component displayed using viewport commands.



























UNI T 2: P age | 19
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

2-D TRANSFORMATIONS
In computer graphics, drawings are created by a series of primitives which are represented by the co-
ordinates of their end points. Certain changes in these drawings can be made by performing some
mathematical operations on these co-ordinates. The basic transformations are scaling, translation and
rotation.

3.1- Introduction
Graphics is as much about the concept of creating pictures as also about making modifications in them.
Most often, it is not changing the pictures altogether, but about making "transformation" in them. Like
shifting the same picture to some other place on the screen, or increasing or decreasing it's size. All
these are essentially mathematical operations.
We view points (and hence pictures, which are nothing but the collections of points) as matrices and
try to transform them by doing mathematical operations on them. These operations yield the new pixel
values, which, when displayed on the CRT give the transformed picture.

3.2- What is transformation?
In CAD we produce picture by their equations. in many cases a complex picture can always be treated
as a combination of straight line, circles, ellipse etc., and if we are able to generate these basic figures,
we can also generate combinations of them.
Once we have drawn these pictures, the need arises to transform these pictures. We are not essentially
modifying the pictures, but a picture in the center of the screen needs to be shifted to the top left hand
corner, say, or a picture needs to be increased to twice it's size or a picture is to be turned through 90
0
.
In all these cases, it is possible to view the new picture as really a new one and use algorithms to draw
them, but a better method is, given their present form, try to get their new counter parts by operating
on the existing data. This concept is called transformation.

3.3- The basic Transformation
Now we are ready to probe into the basics of transformations. As indicated earlier, we talk about
transforming points, throughout the discussions, but any complex picture can be transferred using
similar techniques in succession.
Simple transformation
Translation
Rotation
Scaling







UNI T 2: P age | 20
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com



3.4- Deformable transformations
Shearing
Tapering
Twisting
Etc..
- They all can be combined

3.5- Other classification of transformation:


a) Rigid-Body / Euclidean Transforms:
Rotate, Translate
Preserves distances
Preserves angles
b) Similarity Transforms:
Scaling
c) Linear Transforms
Scaling
d) Affine Transforms
e) Projective Transforms



3.6- Matrix representations of points
Before we start discussing about the actual transformations, we would go through the concept of
representation of points. Once we know how to unambiguously represent a pant, we will be able to
represent all other possible pictures.
Normally, we represent a point by two values in a rectangular coordinate systems as (x,y). x represents
the distance of the point from the origin in the horizontal direction and y in the vertical directions.
Negative values are intended to represent movement in the reverse direction (on a CRT screen,
however, negative valued pixels can not be represented).
However, in the context of graphics we tend to represent a point as a 3 valued entity [ x y 1] where x
and y are the coordinates and 1 is just added to the representation. But use of this additional value
becomes significant shortly.

We have always represented vertices as (x,y)
An alternate method is:
(

=
y
x
y x ) , (
Example:
UNI T 2: P age | 21
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

(

=
8 . 4
1 . 2
) 8 . 4 , 1 . 2 (



3.7- Review of matrix operations
Matrix * Vector

(

=
+ =
+ =
(

=
(

1 0
0 1
'
'
'
'
I
dy cx y
by ax x
y
x
d c
b a
y
x



What does the identity do? AI=A
(
(
(

=
+ + =
+ + =
+ + =
(
(
(

(
(
(

=
(
(
(

1 0 0
0 1 0
0 0 1
'
'
'
'
'
'
I
iz hy gx z
fz ey dx y
cz by ax x
z
y
x
i h g
f e d
c b a
z
y
x


Matrix * Matrix
(

+ +
+ +
=
(

=
(

=
dw cy dz cx
bw ay bz ax
B A
w z
y x
B
d c
b a
A
*
,


Does A*B =B*A? NO What does the identity do? AI=A
(

=
1 0
0 1
?
d c
b a

How are Transforms Represented?
x' = ax + by + c
y' = dx + ey + f
(

'
'
y
x
=
(

e d
b a
(

y
x
+
(

f
c

P=MP+T









UNI T 2: P age | 22
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

3.8- Different transformation procedures

a. Translation
Translation - repositioning an object along a straight-line path (the translation distance) from one
coordinate location to another.
METHOD
Given
) , (
) , (
y x
d d T
y x P
=
=

We want
x
d x x + =
'

y
d y y + =
'

That is how we do it
(

=
y
x
P
(

=
'
'
'
y
x
P
(

=
y
x
d
d
T
P=P+T


Example:
2 . 8 1 . 4 '
1 . 7 7 . 3 '
) 2 . 8 , 1 . 7 (
+ =
+ =
=
y
x
T

1 . 4 '
4 . 3 '
2 . 8
1 . 7
1 . 4
7 . 3
'
'
=
=
(

+
(

=
(

y
x
y
x

Exercise:
P=(2,4), T=(-1,14), P=(?,?)
P=(8.6,-1), T=(0.4,-0.2), P=(?,?)
P=(0,0), T=(1,0), P=(?,?)
Properties of Translation
T(0,0,0)v = v
T(S
x
,S
y
,S
z
)T(t
x
,t
y
,t
z
) v = T(S
x
+ t
x
,S
y
+ t
y
,S
z
+ t
z
) v
T(S
x
,S
y
,S
z
)T(t
x
,t
y
,t
z
) v = T(t
x
,t
y
,t
z
) T(S
x
,S
y
,S
z
) v
T
-1
(t
x
,t
y
,t
z
) v = T(-t
x
,-t
y
,-t
z
) v




UNI T 2: P age | 23
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

b. Scale
Change the size of an original object by certain fectors.

METHOD
Given

) , (
) , (
y x
s s S
y x P
=
=

We want

y s y
x s x
y
x
=
=
'
'

That is how we do it

(

=
(

y
x
s
s
y
x
y
x
0
0
'
'

P=P+T
Example
Given

) 3 , 3 (
) 2 . 2 , 4 . 1 (
=
=
S
P

We want

2 . 2 * 3 '
4 . 1 * 3 '
=
=
y
x

That is how we do it

(

=
(

2 . 2
4 . 1
3 0
0 3
'
'
y
x

6 . 6 '
2 . 4 '
=
=
y
x


Uniform scaling if z y x s s s = =



UNI T 2: P age | 24
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

c. Mirror



d. Rotation

METHOD
Given
) (
) , (
| =
=
R
y x p
SO
|
|
sin
cos
r y
r x
=
=

We want

) sin( '
) cos( '
u |
u |
+ =
+ =
r y
r x

As
u u
u u
cos sin '
sin cos '
y x y
y x x
+ =
=

UNI T 2: P age | 25
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

u | u | u |
u | u | u |
cos sin sin cos ) sin(
sin sin cos cos ) cos(
+ = +
= +

u | u |
u | u |
cos ) sin ( sin ) cos ( '
sin ) sin ( cos ) cos ( '
r r y
r r x
+ =
=

That is how we do it in matrix notation

(


=
(

y
x
y
x
u u
u u
cos sin
sin cos
'
'
=
P=RP

Example
Q: V(-0.6,0) V(0,-0.6) V(0.6,0.6)
Rotate -30 degrees
Ans V(0,0.6) V(0.3,0.9) V(0,1.2)


e. Window-Viewport Mapping
Given a window and view port, what is the transformation matrix that maps the window from world
coordinates into the view port in screen coordinates? This matrix can be given as a three-step
transformation composition as suggested by the following sequence of pictures:







UNI T 2: P age | 26
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

Window-Viewport Mapping
Matrix representation

Combining Transformations
Using translate, rotation, and scale, how ?
Translation
T(tx, ty)
Translation distances
Scale
S(sx,sy)
Scale factors
Rotation
R(u)
Rotation angle

We must do each step in turn. First we rotate the points, then we translate, etc.
Since we can represent the transformations by matrices, why dont we just combine them?
' ' ' ' '
' ' '
'
P S P
P R P
T P P
- =
- =
+ =




UNI T 2: P age | 27
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com



Final Transformations 2D and 3D
( )
( ) ( )
( )
( ) ( )
( )
( ) ( ) P R P P R P
y
x
y
x
y
x
y
x
R
P s s S P P s s S P
y
x
s
s
y
x
y
x
s
s
y
x
s s S
P t t T P P t t T P
y
x
t
t
y
x
y
x
t
t
y
x
t t T
y x y x
y
x
y
x
y x
y x y x
y
x
y
x
y x
- = - =
(
(
(

(
(
(


=
(
(
(


=
(

=
- = - =
(
(
(

(
(
(

=
(
(
(

=
(

=
- = + =
(
(
(

(
(
(

=
(
(
(

+
(

=
(

=
u u
u u
u u
u u
u u
u
1 1 0 0
0 cos sin
0 sin cos
1
'
'
cos sin
sin cos
'
'
, ,
1 1 0 0
0 0
0 0
1
'
'
0
0
'
'
,
, ,
1 1 0 0
1 0
0 1
1
'
'
'
'
,






























UNI T 2: P age | 28
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

PROJECTIONS
In drawing practice, a 3-dimensional object is represented on a plane paper. Similarly in computer graphics a
3-dimensional object is viewed on a 2-dimensional display. A projection is a transformation that performs this
conversion. Three types of projections are commonly used in engineering practice: parallel, perspective and
isometric.
Parallel (Orthogonal) Projection
This is the simplest of the projection methods. Figure 5.12 shows the projection of a cube on to a projection
plane. The projectors, which are lines passing through the corners of the object are all parallel to each other. It is only
necessary to project the end points of a line in 3-D and then join these projected points. This speeds up the
transformation process. However, a major disadvantage of parallel projection is lack of depth information.
Perspective Projection
The perspective projection enhances the realism of displayed image by providing the viewer with a sense of
depth. Portions of the object farther away from the viewer are drawn smaller then those in the foreground. This is
more realistic as it is the way we see an object. In perspective projection the projectors connect the eye with every
point of the object and therefore all projectors converge to the eye.
Relevance of Isometric Drawings
As we have seen we can make 3d models in pro e more easily then conventional drafting software but up till now we
have seen 3d or perspective projection of drawings not orthographic projections.
Perspective projection is closer to reality but less accurate as will be clear in this example: - we have made
100x100x100 cube and dimensioned id on 2d planes in isometric view watch the dimensions carefully




See what happen to 100x100x100 cube dimensions in
isometric orientation

SO WE SEE 3D REPRESENTATION IS NOT GOOD ENOUGH FOR DRAWING THAT
HAVE TO GO N MANUFACTURING FLOOR.





UNI T 2: P age | 29
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

COMPARISION BETWEEN DIFFERENT TYPE OF PROJECTION
ACCUR
ACY
REALISM Where they are used
1.
ORTHOGRAPHI
C PROJECTIONS

HEIGHE
ST
LOWEST Mostly in engineering and technical applications,
2D animations, and some famous 2D games like
Mario used this type of projections.
2.
AXONOMETRIC
PROJECTION

It is widely used in simple game designs it is also
called 2.5D
SimCity 2000 and SimCity 3000 were dimetric and
SimCity 4 is trimetric.
3. OBLIQUE
PROJECTIONS

Pac-Mania, Ultima VII and Earthbound, three
games that looked a bit odd at times, but generally
benefited from using Oblique projection.
4. PERSPECTIVE
PROJECTION
LOWES
T
HEIGHEST Animation MOVIES, Games, Engineering(where
representation is important not for production
purpose) it is most widely used projection


Drawing Module
Using AutoCAD, Pro/ENGINEER or Catia Drawing mode
- You can create drawings of models, or import drawing files from other systems.
- You can annotate the drawing with notes, manipulate the dimensions, and use layers to manage the
display of different items.

ORTHOGRAPHIC PROJECTION
Orthographic projection is the graphical method used in modern engineering drawing.
In order to interpret and communicate with engineering drawings a designer must have a sound
understanding of it's use and a clear vision of how the various projections are created.
The word orthographic means to draw at right angles and is derived from the Greek words:
ORTHOS - straight, rectangular, upright
GRAPHOS - written, drawn

There are two predominant orthographic projections
Projections created with the object placed in the first quadrant are said to be in First
Angle projection, and likewise, projections created with the object placed in the third
quadrant are said to be in Third Angle projection.
UNI T 2: P age | 30
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com


Projection system symbols and recommended proportions






















UNI T 2: P age | 31
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com






































































UNI T 2: P age | 32
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com






































































UNI T 2: P age | 33
ARYA COLLAGE OF ENGINEERING AND INFORMATION TECHNOLOGY
BY MANU GUPTA-09352601453- manukota1@gmail.com

Potrebbero piacerti anche