You are on page 1of 109
Ch 3 Computer Graphics

Ch 3 Computer Graphics

Convert vector straight lines to raster images to be displayed on a raster terminal utilizing

Convert vector straight lines to raster images to be displayed on a raster terminal utilizing the pixel information Understand the problems associated with displaying vectorial information on a raster terminal Various types of coordinate systems used in displaying CAD information The data requirements of a graphic image and the database storage methods used Learn about the engineering data management systems

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

2

Different types of geometric transformations used during CAD geometry generation and display and their evaluation

Different types of geometric transformations used during CAD geometry generation and display and their evaluation Mathematics required to display a 3D image on the 2D screen of the display device Understand the problems associated with the display of graphic images in the display screen such as clipping and hidden line elimination Learn about adding colour and shading to the display for better visualization.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

3

DDA or Digital Differential Analyser is one of the first algorithms developed for rasterising the

DDA or Digital Differential Analyser is one of the first algorithms developed for rasterising the vectorial information. The equation of a straight line is given by Y = m X + C

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

4

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

5

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed

6

Bresenham's method is an improvement over DDA since it completely eliminates the floating ‐ point

Bresenham's method is an improvement over DDA since it completely eliminates the floatingpoint arithmetic except for the initial computations. All other computations are fully integer arithmetic thus is more efficient for raster conversion

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

7

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
8

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed

9

The rasterisation algorithms discussed earlier will be generating the pixel points by rounding off to

The rasterisation algorithms discussed earlier will be generating the pixel points by rounding off to the nearest integer. As a result the inclined lines have the jagged effect often called the staircase effect as shown in Fig. 35.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

10

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

11

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

12

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
13
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

14

The right handed cartesian coordinate system is used for defining the geometry of the parts.

The right handed cartesian coordinate system is used for defining the geometry of the parts. In order to specify the geometry of a given solid, it is necessary to use a variety of coordinate systems. World Coordinate System User Coordinate System Display Coordinates

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

15

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
16
This refers to the actual co ‐ ordinate system used as master for the component.

This refers to the actual coordinate system used as master for the component. Some times it may also be called as model coordinate system.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

17

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

18

However, sometimes it becomes difficult to define certain geometries if they are to be defined

However, sometimes it becomes difficult to define certain geometries if they are to be defined from the WCS. In such cases alternate coordinate systems can be defined relative to the WCS. These coordinate systems are termed as user coordinate systems (UCS) or working coordinate systems.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

19

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

20

This refers to the actual coordinates to be used for displaying the image on the

This refers to the actual coordinates to be used for displaying the image on the screen.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

21

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

22

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
23
The major functions of a database are to manipulate the data on screen, such as

The major functions of a database are to manipulate the data on screen, such as zooming and panning; to interact with the user, essentially for the purpose of editing functions like trimming, filleting, stretching, etc.; to evaluate the properties like areas, volumes, inertias, etc. to provide additional information like manufacturing specifications.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

24

Organisational data Identification number, Drawing number, Technological data Geometry, Dimensions, Design origin and status of

Organisational data Identification number, Drawing number,

Technological data Geometry, Dimensions,

Design origin and status of Tolerances,

changes, Current status, Designer name, Date of design, Scale, Type of projections, Company.

Surface finishes, Material specifications or reference, Manufacturing procedures, Inspection procedures.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

25

Allow for greater interaction of the user with the modelling system. Support a large variety

Allow for greater interaction of the user with the modelling system. Support a large variety of types of data to be represented in the database as explained earlier. The data structure should be able to allow for associating the data with the modelling process. The data should allow for storing information in the most compact form possible. Data should maintain complete associativity with all the downstream and upstream applications.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

26

Database can be defined as a collection of data, which is shared throughout a given

Database can be defined as a collection of data, which is shared throughout a given process for multiple applications. Data record: Data record consists of a series of facts or statements. Data File: A file is a collection of data items put together. Data field: A field is a single unit of data stored as part of a database record. Data model: Data model is concerned with what the data in the database is represented.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

27

The hierarchical model The network model, and The relational model 10 July 2013 (c) TMH,

The hierarchical model The network model, and The relational model

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

28

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
29
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

30

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

31

In most of the geometric modellers a combination of random and sequential form of data

In most of the geometric modellers a combination of random and sequential form of data storage is used.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

32

10 July 2013

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

33

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
34
The management of large amount of data over the entire life cycle of the product

The management of large amount of data over the entire life cycle of the product is called by a number of names with different understanding such as Product Data Management (PDM), Product Information management (PIM), Engineering Data Management (EDM), Technical Documentation Management (TDM), Engineering Management System (EMS), etc.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

35

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
36
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
37
(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed

10 July 2013

38

Translation Scaling Reflection or Mirror Rotation 10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles

Translation Scaling Reflection or Mirror Rotation

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

39

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
40
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

41

This moves a geometric entity in space in such a way that the new entity

This moves a geometric entity in space in such a way that the new entity is parallel at all points to the old entity.

P* = [x*, y*]

 

x* = x + dX

y* = y + dY

 

[

 

]

 

*

x

 

x + dX

P *

=

y *

=

 

y + dY

 

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

42

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
43
Scaling is the transformation applied to change the scale of an entity P* = [X*,

Scaling is the transformation applied to change the scale of an entity

P* = [X*, Y*] [P * ] = [T s ] . [P]

[

P

*

] =

S

x

0

= [S x × X, S y × dY]

0

y

x

⎥ ⎦ ⎣

y

S

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

44

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

45

Reflection or mirror is a transformation, which allows a copy of the object is to

Reflection or mirror is a transformation, which allows a copy of the object is to be displayed while the object is reflected about a line or a plane. P* = [X*, Y*] = [X, Y]

[

P

*

] =

⎡ 1 ⎢
⎡ 1

0

0 1

⎡ ⎤

x

⎦ ⎣ ⎦

y

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

46

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

47

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

48

The final position and orientation of a geometric entity is decided by the angle of

The final position and orientation of a geometric entity is decided by the angle of rotation and the base point about which the rotation, θ

[

P

*

] =

*

x

y *

=

cos

sin

θ

θ

sin

cos

θ

⎥ ⎦ ⎣

θ

x

y

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

49

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

50

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

51

[P*] = [Tn] [Tn ‐ 1] [Tn ‐ 2] .. [T3] [T2] [T1] 10 July

[P*] = [Tn] [Tn1] [Tn2]

..

[T3] [T2] [T1]

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

52

[ P * ] = ⎡ x ⎢ ⎢ ⎣ ⎢ ⎤ * y * ⎥

[

P

*

]

=

x

⎣ ⎢

*

y * ⎥ =

1

⎥ ⎦

1

0

⎢ ⎣ 0

0

1

0

dX ⎤ ⎡ x

dY

1

y

⎦ ⎥ ⎣ ⎢ ⎦ ⎥

1

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

53

Translate the point P to O, the origin of the axes system. Rotate the object

Translate the point P to O, the origin of the axes system. Rotate the object by the given angle Translate the point back to its original position.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

54

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

55

Translate the mirror line along the Y ‐ axis such that the line passes through

Translate the mirror line along the Yaxis such that the line passes through the origin, O Rotate the mirror line such that it coincides with the Xaxis. Mirror the object through the Xaxis. Rotate the mirror line back to the original angle with Xaxis. Translate the mirror line along the Yaxis back to the original position.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

56

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

57

Translate the point P to O, the origin of the axes system. Rotate the object

Translate the point P to O, the origin of the axes system. Rotate the object by the given angle Translate the point back to its original position.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

58

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

59

⎡ x * ⎢ ⎢ ⎢ y * * ⎢ ⎣ z 1 ⎤ ⎥ ⎥

x

*

y *

*

z

1

=

1

0

0

0

0

1

0

0

0

0

1

0

dX

x ⎤ ⎥ ⎥ ⎥ ⎥ ⎦

y

z

1

⎥ ⎢ dY ⎥ dZ ⎥ ⎢ ⎥ ⎢ ⎢
dY
dZ ⎥ ⎢
⎥ ⎢

1

⎦ ⎣

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

60

⎡ x * ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ y * z * 1 ⎥ ⎥

x *

y *

z

*

1

=

⎡ ± 1

0

0

0

0

0

±

1

0

0

±

1

0

0

0 ⎤ ⎡ x

0

0

1

⎦ ⎣

y

z

1

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

61

⎡ x * ⎤ ⎡ cos ⎢ ⎢ ⎢ ⎢ ⎣ ⎥ y * z 1

x * ⎤ ⎡ cos

y *

z

1

*

=

sin

0

0

θ

sin

θ

0

θ

cos

θ

0

 

0

1

0

0

0 ⎤ ⎡ x

0

0

1

y

z

⎦ ⎣ ⎦

1

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

62

Orthographic projection Isometric projection 10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications

Orthographic projection Isometric projection

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

63

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

64

10 July 2013

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

65

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

66

This helps in discarding the part of the geometry outside the viewing window, such that

This helps in discarding the part of the geometry outside the viewing window, such that all the transformations that are to be carried out for zooming and panning of the image on the screen are applied only on the necessary geometry.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

67

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

68

To know whether the line is completely inside or outside the clipping rectangle can be

To know whether the line is completely inside or outside the clipping rectangle can be done by comparing the end points of the line with the clipping boundaries.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

69

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

70

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

71

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
72
In this method all the lines are classified as to whether they are in, out

In this method all the lines are classified as to whether they are in, out or partially in the window by doing an edge test. T = 1 if point is above top of window = 0 otherwise B = 1 if point is above below of window = 0 otherwise R = 1 if point is above right of window = 0 otherwise L = 1 if point is above left of window = 0 otherwise

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

73

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

74

The line clipping algorithm discussed earlier can be modified to obtain polygon clipping. However, as

The line clipping algorithm discussed earlier can be modified to obtain polygon clipping. However, as can be seen from Fig. 341, extending the line clipping procedure described above produces a result, which can mean more than one geometry.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

75

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

76

The basic idea used in polygon clipping is that an n ‐ sided polygon is

The basic idea used in polygon clipping is that an nsided polygon is represented by n vertices. On each of the polygon two tests are conducted. If the line (edge of the polygon) intersects the window edge, the precursor point is added to the output list. If the next vertex is outside the window, discard it otherwise add to the output list. This process is repeated for all the edges of the polygon.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

77

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

78

Removing hidden lines and surfaces greatly improves the visualisation of the objects. Back ‐ face

Removing hidden lines and surfaces greatly improves the visualisation of the objects. Backface removal Zbuffer (depth buffer) Depth sort algorithm

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

79

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013
(c) TMH, New Delhi, CAD/CAM Principles
and Applications by P N Rao, 3rd Ed
80
The basic concept used in this algorithm is that only those faces that are facing

The basic concept used in this algorithm is that only those faces that are facing the camera (centre of projection) are visible.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

81

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

82

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

83

The Z ‐ buffer is a separate depth buffer used to store the z ‐

The Zbuffer is a separate depth buffer used to store the zcoordinate (depth) of each pixel in the geometric model. This method utilises the principle that for each of the pixel locations, only that point with the smallest Zdepth is displayed.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

84

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

85

The depth sort algorithms utilize the principle of painting the polygons into the frame buffer

The depth sort algorithms utilize the principle of painting the polygons into the frame buffer in the order of decreasing distance (depth) from the view point. Sort all the polygons according to the smallest zcoordinate of each Resolve any ambiguities (Fig. 3.47) when the zcoordinates of polygons overlap, by splitting the polygons Scan convert each polygon in ascending order from back to front (in terms of zcoordinate)

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

86

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

87

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

88

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

89

Y S 3 S 2 S 4 S 1 X 10 July 2013 (c) TMH, New

Y

S 3 S 2 S 4 S 1
S
3
S
2
S
4
S
1

X

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

90

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

91

The use of colours enhances the presentation of information in CAD/CAM in a number of

The use of colours enhances the presentation of information in CAD/CAM in a number of ways. Using different colours for different type of geometric entities during the construction stage helps the engineer to follow the modelling processes with more clarity.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

92

RGB Model CMY Model HSI Model YIQ Model 10 July 2013 (c) TMH, New Delhi,

RGB Model CMY Model HSI Model YIQ Model

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

93

Red light Cyan Magenta Yellow Blue light Green light 10 July 2013 (c) TMH, New Delhi,
Red light Cyan Magenta Yellow
Red light
Cyan
Magenta
Yellow

White

Blue light

Green light

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

94

Yellow dye Green Red Black Blue Cyan dye Magenta dye 10 July 2013 (c) TMH, New
Yellow dye Green Red
Yellow dye
Green
Red

Black

Blue

Cyan dye

Magenta dye

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

95

Having studied the principles that are required for displaying realistic graphical images without the hidden

Having studied the principles that are required for displaying realistic graphical images without the hidden surfaces, the next logical step is render them by incorporating the correct shading of different surfaces.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

96

The light that is falling on the object can be coming from a light source

The light that is falling on the object can be coming from a light source such as sun or a light bulb, or a reflected light, for example the reflected light from the light bulb form the surrounding walls. It is the reflected light that allows the object to be seen as shown in Fig 3.52. Specular reflection is the property of a surface that reflects the incident light in a nearly fixed direction and without affecting its quality. It is this reflection that is responsible for the highlights seen on shiny objects.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

97

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

98

In the Lambert shading method also called as faceted shading, the surface of the object

In the Lambert shading method also called as faceted shading, the surface of the object is approximated by polygons (flat surface) even though it is smooth. This gives rise to the appearance of the smooth solid as a faceted solid as shown in Fig 3.53.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

99

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

100

The smoothness is obtained by linearly interpolating a colour or shade across the polygon unlike

The smoothness is obtained by linearly interpolating a colour or shade across the polygon unlike the Lambert shading which has a single colour across the entire polygon. In order to do this, intensity is calculated for each pixel rather than one intensity for the entire polygon. It is also called intensity interpolation and is very simple and effective method of adding a curved feel to a polygon that would otherwise appear flat. S E = S A + (X E X A )* G AB S D = S A + (X D X A )* G AB

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

101

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd
10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

102

10 July 2013 (c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

103

Determine a normal vector at each vertex of a polygon similar to the procedure used

Determine a normal vector at each vertex of a polygon similar to the procedure used in Gouraud shading. Interpolate normal vectors along the edges of the polygon. Interpolate normal vectors across each scan line, so that there is one normal vector for each pixel in the polygon. Apply an illumination model at positions along scan lines to calculate pixel intensities using the interpolated normal vectors.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

104

N (X X ) N (X A B − C + B C − X )

N (X X ) N (X

A

B

C

+

B

C

X )

A

X

B

X

A

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

105

In order to display the graphical information, which is vectorial in nature, it is necessary

In order to display the graphical information, which is vectorial in nature, it is necessary to convert it into raster format. For converting lines into raster format, DDA algorithm is simplest while Bresenham’s algorithm reduces the computations into integer format thereby making it a faster alternative. It is necessary to modify the pixel information for display to get more realistic visual experience. Depending upon the type of graphic display used, it is necessary to be familiar with a number of different coordinate systems to facilitate the graphic construction as well as display.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

106

In addition to the actual graphic information, a large amount of additional data such as

In addition to the actual graphic information, a large amount of

additional data such as organizational and technological data is

stored with the product data.

Three different types of data models are used for storing

modelling data. They are hierarchical model, network model

and the relational model. Of these the relational model quite

extensively is used because of its flexibility in usage. It

maintains data tables and pointers to store the required data in

a very compact manner.

Engineering data management (EDM) takes care of all the data

that is required for a given product throughout its life cycle.

Geometric transformations can be handled conveniently using

matrix algebra. For this purpose it is necessary to use

homogenous representation of vertex data.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

107

Various transformations that are quite useful are translation, rotation, scale and reflection. It is possible

Various transformations that are quite useful are translation, rotation, scale and reflection. It is possible to extend these basic transformations for more complex transformations. The 2D transformation methods can be easily extended into 3D. The 3D geometry data needs to be converted into 2D by adopting a suitable projection system such as orthographic, isometric or perspective projection. Since only part of the geometric model will be displayed most of the time, it is necessary to clip the information outside the display window. A number of methods are available for straight line as well as polygon clipping.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

108

Line clipping is simple, but polygon clipping will be more comprehensive and can be easily

Line clipping is simple, but polygon clipping will be more comprehensive and can be easily extended to 3D. Also it is necessary some times to remove the hidden lines to make the display easier to understand. For this purpose back face removal, depth buffer (Z) and depth sort algorithm are used. There are a number of colour models used with the graphic displays and hard copies. Adding colour and shading coupled with the removal of hidden surfaces allows for realistic visualization of objects modelled. Gourad shading and Phong shading models are frequently used to get smoothly shaded 3D profiles.

10 July 2013

(c) TMH, New Delhi, CAD/CAM Principles and Applications by P N Rao, 3rd Ed

109