Chapter 4
Chapter 4
3. Manipulation of image
a. Image-space Graphics
Image directly manipulated to create a picture
Example: Microsoft Paintbrush
b. Object-space Graphics
Image representation of a separate model
Separate model is manipulated
CAD :
1. Display Devices
Display image to the user
2. Plotting Device
Generates hard copy
Raster-Scan CRT:
Principle:
Intensity of each pixel in a rectangular matrix that covers the screen is controlled
Monochrome Images:
Greyscale Images:
Additional bits per pixel allocated
4 bits per pixel allow 2^4=16 colors or shades of grey
16 colors satisfactory to distinguish different elements on the screen
For smoothly shaded image, 256 colors are deployed or 8 bits per pixel
High performance graphics devices use 24 bits per pixel
o To represent intensity of separate red, green and blue guns of CRT
Modern displays have resolution grom 640 x 480 to 1800 x 1600 pixels or higher
o Typically 8 or 24 bit devices
Saturation:
Hue:
Lightness/Intensity:
Brightness:
Saturation, hue and intensity can help specify the level of additive primary colors
Structure:
Use crossed polarizers sandwiching a very thin liquid crystal layer between layers onto
which thin grid wires are aligned- one horizontally and another vertically
Liquid crystal rotates polarized light through 90 degrees
o So that it can pass through polarizers
When horizontal and vertical grids have electric potential applied, resultant field
energizes the crystal at the position of the crossed wires
o It no longer rotates the polarized lights
Light is absorbed
A dark spot is shown on the display
Complete display is formed in raster-scan fashion, row by row
Effect of energizing crystal gives display persistence
Advantage:
Disadvantage:
Plasma Panel:
Pixel is formed by a neon-tube type action on an inert gas sandwiched between two glass panels
High contrast
Poor color capability
Electroluminescent Display:
Matrix grid of wires used to address a layer of electroluminescent material with a high
electric field
Works as alternative to LCD
Projection CRT:
Allow large screen images
Project light from 3 very bright monochrome displays with red, green and blue filters
Poor resolution
Discrete nature of display
o Slanting lines and curves are not enough smooth
o Show staircasing effect
o Can be solved by antialiasing
Antialiasing:
The technique that smooths sharp edges by modifying the intensity of pixels at steps, is known as
antialiasing.
Example: If a line is considered to be 1 pixel wide, then pixel intensity might be set to be
proportional to the area of the pixel covered by the line.
1. Vector Plotters
2. Raster Plotters
Hard Copy:
Advantage:
Disadvantage:
Slow
Does not easily allow for polygon areas to be filled with solid color or grey scale
Raster Plotter:
Ink-jet Printer:
Ink of different color is sprayed from tiny jets in a print head traversing across the paper
Thermal Devices:
Model of design represented using real valued numbers in two or three dimensions
Representation is drawn on VDU screen
Display is defined by integer numerical coordinates
Aim of CAD is to perform the transformation from design model to display efficiently
Converting the geometric representation of the model to a form that may be manipulated
easily by graphics routines
o Converting curves and text to a series of lines
Mapping or transforming the lines from the model coordinate system to the screen
coordinate system
Selecting the lines that would be visible in the screen display area and discarding the rest
o Known as clipping step
Instructing display device to draw the visible lines
Vector Generation:
Graphics image displayed as a large collection of lines on the screen regardless what the
image involves
Allows display of any geometric entity
o Involves spline, surface, text, graphical symbols
Graphical routines of the program only have to deal with one type of geometric element-
line
o Greatly simplifies image manipulation
Aim-
o Use sufficient display lines for the curve to appear smooth
o Number needed is controlled by display tolerance
Usually lines are drawn between points on the nominal curve shape
No of vectors used is trade-off between appearance of entities and display performance
Display tolerance:
The maximum deviation of the vector representation from the true curve shape is known as
display tolerance
Coarse display tolerance implies very polygonal curves
Fine display tolerance needs calculation of a large number of curve points
o Computationally expensive
Windowing Transformation:
Zoom and Pan is used to display only the part of the model
o Display Control Commands
Window:
An imaginary rectangular frame or boundary through which the user looks onto the model, is
known as window.
Viewport:
The area on the screen in which the contents of the window are to be displayed as an image is
known as viewport
Aspect ratio of window and viewport are same
Viewing Transformation:
The process of mapping from model coordinate system to screen coordinate system is known as
viewing transformation.
Windowing Transformation:
No rotation applied
Less general case
𝒙𝒗 − 𝒗𝒙𝒍 𝒙𝒘 − 𝒘𝒙𝒍
=
𝒗𝒙𝒓 − 𝒗𝒙𝒍 𝒘𝒙𝒓 − 𝒘𝒙𝒍
𝒚𝒗 − 𝒗𝒚𝒃 𝒚𝒘 − 𝒘𝒚𝒃
=
𝒗𝒚𝒕 − 𝒗𝒚𝒃 𝒘𝒚𝒕 − 𝒘𝒚𝒃
Clipping:
The operation of efficiently identifying which part of vectors are within the window and
discarding the rest is known as clipping.
Otherwise vectors outside the window may lead to undesirable effect if mapped on screen
o Write over a text area of screen
o Have their coordinates set to screen boundary values
Line Drawing:
Drawing line on a raster display by setting appropriate bits in the frame buffer
o Cases where video controller is closely connected to the main CAD processor
Instructing a remote process to draw a vector
Protocol:
A set of rules that control the exchange of data between communicating devices
Governs-
o Communication between computer and display terminals
o Two devices on a network
Client-Server Approach:
Transform
Vectorize Clip to Draw
viewport
Clipping can occur after transformation
o Appropriate if hardware is available
Viewing Transformation:
Rotation:
1. About z axis-
𝒙′ 𝒄𝒐𝒔𝜽 𝒔𝒊𝒏𝜽 𝟎 𝒙′
𝒑′ = [𝒚′ ] = [−𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽 𝟎] [𝒚′ ]
𝒛′ 𝟎 𝟎 𝟏 𝒛′
2. About x axis-
𝒙′ 𝟏 𝟎 𝟎 𝒙
′ ′
𝒑 = [𝒚 ] = [𝟎 𝒄𝒐𝒔𝜽 𝒔𝒊𝒏𝜽] [𝒚]
𝒛′ 𝟎 −𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽 𝒛
3. About y axis-
𝒙′ 𝒄𝒐𝒔𝜽 𝟎 −𝒔𝒊𝒏𝜽 𝒙
′ ′
𝒑 = [𝒚 ] = [ 𝟎 𝟏 𝟎 ] [ 𝒚]
𝒛′ 𝒔𝒊𝒏𝜽 𝟎 𝒄𝒐𝒔𝜽 𝒛
Scaling:
X’=x/S
Y’=y/S
Z’= z/S
S=Scaling factor
Translation:
X’=x-dx
Y’= y-dy
Z’= z-dz
Homogeneous Coordiantes:
Involves representing 3-element position vecotrs by four element vectors of form
[ wx wy wz w]r
Here w is scale factor usually counted as 1
Visual Realism:
Edges or vectors of the model obscured by visible surfaces are omitted from display of
image
Sometimes displayed as dashed lines
Also known as visible line identification
Process similar to clipping
Involves segmentation and partial display of partly obscured edges
Difference with Clipping:
o Tests edges in the model against multiple boundaries
Lenghty process
Computationally expensive
Easy to test against flat face
Difficult with general surfaces
Boxing test and spatial subdivisions employed to improve performance
Involves object-space techniques
Tessellation :
Technique that subdivides surfaces into planar polygons for hidden-line removal is known as
tessellation.
Hidden-surface Removal:
Depth-buffer/Z-buffer Algorithm:
Simplest hidden surface removal algorithm
Uses frame buffer for display to store color values for the pixels
Z-buffer used to store current z-value for each pixel
Z value is the distance or depth from viewing point of the nearest object to the pixel
processed by the algorithm
Equivalent pixel in the frame buffer stores the shade of that object
Working Principle:
Advantage:
Disadvantage:
Brute-force approach
Larfe memory required for buffer
Coherence:
Describes-
Temporal Coherence:
Scanline Coherence:
Spatial Coherence:
Similarity in color between adjacent parts of picture
Types of Illumination:
Diffuse Illumniation
o Light of equal intensity strikes the object from all directions
o Akin to ambient light reflected from walls and ceilings or transmitted through
cloud
o Represented by ambient intensity Ia
Point-source Illumination
o From sun,light bulbs,candles etc with intensity Ip
o Location represented by p, from the point of interest on the face to the point
source
Shading Method:
1. Flat Shading
2. Gouraud Shading
3. Phong Shading
Gouraud Shading:
Phong Shading:
Ray Tracing:
Radiosity: