Professional Documents
Culture Documents
UNIT 1:: Overview of Graphics System Characteristics of Cathode-Ray Tube (CRT)
UNIT 1:: Overview of Graphics System Characteristics of Cathode-Ray Tube (CRT)
CRT Diagram
DEEPTI PATEL
Advantage of CRT
High Quality to Cost Ratio Variable Resolutions Fast Pixel Response Time Wide Viewing Angles
Disadvantage of CRT
Size to Screen Size Discrepancy Higher Energy Consumption Refresh Rate Flicker Large Overall Size
DEEPTI PATEL
Input Devices::
o o o o o o o o o o o Keyboard Mouse Digitizer Trackball Touch Screens Light Pens Microphones Bar code readers Joysticks Scanners Voice Systems
Computer Graphics application:: 1. Computer generated art 2. Video games 3. Movies 4. CAD [ Computer Aided Design ] 5. Information visualization 6. Forensic science
DEEPTI PATEL
DEEPTI PATEL
o Viewing Defines which particular view of the model is required. This involves indicating where a virtual camera should be placed and in which direction it should point. o Rendering: Producing the image on the output device. Includes: Removing hidden surfaces Calculating the shade of visible surfaces Scan converting the graphics primitives (lines, polygons, etc) into corresponding sets of points on the display device. o A bitmap image a frame buffer with one bit per pixel.
DEEPTI PATEL
o A Pixmap image a frame buffer with multiple bits per pixel. o Horizontal retrace: the return of the electron beam to the left of the screen after refreshing each scan line. o Vertical retrace: the return of the electron beam to the top left corner of the screen to begin its next frame. o CAD can be defined as the use of computer systems to perform certain functions in the design process. o Refresh CRT :: i. When pixel is drawn and light will generate and then second pixel will draw. ii. This process done in Nanosecond so we see the continuous picture but actually pixel is redraw each and every time so its called Refresh CRT. o Persistence : How long Electron beam Continue to emit light after the CRT beam is removed. o Resolution : The Maximum number of point that can be display without overlap on a CRT is referred to as the resolution. o Aspect Ratio: The Number gives the Ration of Vertical point to horizontal point to produce equal length lines in both directions on the CRT screen its called Aspect Ratio. o CAM is the use of computer systems to plan, manage and control the operations of manufacturing plant through either direct or indirect computer interface with the plants production resources. o Tomography is a technique of X-Ray photography that allows crosssectional views of physiological systems to be displayed.
DEEPTI PATEL
Short Forms:
1. CAD/CAM = Computer Aided Design and Computer Aided Manufacturing 2. Cathode ray tube [crt] 3. Liquid-crystal displays (LCD)
Only 2 bit is used. It will use 3 bit per pixel. It will only use color either on or off. Color electron gun is used. Shadow mask grid is not used. Shadow mask grid is used. It gives output only 2 bit i.e. either It gives color more output. 00,01,10,11.
DEEPTI PATEL
It goes each and every line in the screen It goes only to those space when and when object is g\drawn it will put pixel object is to be drawn and drawn a point Ex: Printer Ex: Plotter
DEEPTI PATEL
Plot
DEEPTI PATEL
Bresenhums Line Algorithm:: 1. Slope M = (y2-y1)/(x2-x1) 2. P0=2y-x 3. If Pk<0 Next point[(Xk+1),Yk] Pk+1=Pk+2y If Pk>=0 Next point (Xk+1,Yk+1) Pk+1=Pk+2y-2x
DEEPTI PATEL
Properties of circle: Equidistance from a center point Polar co-ordinates Cartesian co-ordinates =>> Cartesian co-ordinates (X-Xc) 2+(Y-Yc) 2=r2 =>> Polar co-ordinates X=Xc+rcos Y=Yc+rsin
DEEPTI PATEL
Octet
1 Pk<0 (Xk+1,Yk)
Formulas
Pk+1=Pk + 2(Xk+1) + 1 Pk+1=Pk + 2(Xk+1) 2(Yk-1) Pk+1=Pk + 2(Yk+1) + 1 Pk+1=Pk + 2(Yk+1) 2(Xk-1) Pk+1=Pk 2(Yk-1) + 1 Pk+1=Pk+ 2(Yk-1) 2(Xk-1) Pk+1=Pk + 2(Xk+1) + 1 Pk+1=Pk+ 2(Xk+1) 2(Yk-1) Pk+1=Pk-2(Xk-1)+1 Pk+1=Pk-2(Xk-1)+1+2(Yk+1) Pk+1=Pk-2(Yk-1)+1 Pk+1=Pk-2(Yk-1)+1+2(Xk+1) Pk+1=Pk-2(Yk+1)+1 Pk+1=Pk+2(Yk+1)+1+2(Xk+1) Pk+1=Pk-2(Xk-1)+1 Pk+1=Pk- 2(Xk-1) - 1 - 2(Yk-1)
Pk>=0 (Xk-1,Yk-1)
DEEPTI PATEL
p10 = ry rx ry + 1 rx 4
2 2
When 2ry2x 2rx2y then STOP Step2: (X0, Y0) = (Last step1 X value, Last step1 Y value)
p20 = ry (x0 + 1 ) + rx ( y0 1) rx ry 2
2 2 2 2 2
p 2 k +1 = p 2 k 2 rx y k +1 + rx
2
DEEPTI PATEL
Fill Algorithms::
o Three different algorithms: 1. Scan-line fill 2. Boundary fill 3. Flood fill
Boundary Fill
1 2 3 4 It will check boundary color as well as fill color It check exterior Point In boundary fill algorithm it will fill inside as well as boundary of the polygon It will not replace the pixel color by another pixel color
Flood Fill
It will only check the old color i.e. interior color It will check interior Pixel It will only fill the interior side of the polygon not boundary of the polygon It will replace the pixel color by new pixel color
DDA Algorithm
1 This is Simplex algorithm available in graphics This is faster method End point accuracy is poor because of rounding of decimal values It will not work for complex diagram or figure as it is orientation dependent It includes integer and decimal calculation for addition, subtraction, multiplication, and division We can draw smooth lines using this algorithms
Bresenhams Algorithm
This is complex algorithm available in graphics This is not faster method End point accuracy is not poor It will work for complex diagram or figure as it is orientation independent It includes only the integer calculation such as addition, subtraction Meant for the basic line drawing but we can not draw smooth lines using these algorithms.
2 3 4 5
DEEPTI PATEL
UNIT 3:: Two Dimensional Geometric Transformation and Two Dimensional Viewing Two Dimensional Geometric Transformations:
1. Basic Transformation 2. Matrix Representation 3. Composite Transformation 4. Other Transformations
DEEPTI PATEL
o Non-Uniform Scaling
Where, sx, sx, sx are the scale factors for the x, y, and z coordinates of the object.
DEEPTI PATEL
In general, the points matrix and the transformation matrix are re-written as
Composite Transformation
DEEPTI PATEL
Other Transformations::
Reflection Shear
DEEPTI PATEL
WC ,VC = R
R: rotation matrix T: translation matrix
DEEPTI PATEL
The steps in this coordinate transformation Translate the viewing origin to the world origin, then Rotate to align the axes of the two systems
= =
sx = sy =
xv xw yv yw
DEEPTI PATEL
Clipping operations
Point Clipping::
Line Clipping::
= =
+ +
M=(Y2-Y1)/(X2-X1)
X=X1+(1/M)(YT-Y1) Y=YT X=X1+(1/M)(YB-Y1) Y=YB X=XR Y=M(XR-X1)+Y1
DEEPTI PATEL
X=XL Y=M(XL-X1)+Y1
EXAMPLE: An object ABCD having the co-ordinates A=(10,10); B=(110,10); c=(110,110); D(10,110) is to be clipped for the following line: 1. EF having the end point (25,75) & (90,100) 2. GH having the end point (125,35) & (110,120) 3. IJ having the end point (50,50) & (120,120)
E F
0000 0000
DEEPTI PATEL
Liang-Barsky Line Clipping Algorithm: 1. Read the end point of line(x1,y1) and (x2,y2) 2. Read the two corners of the window having co-ordinates Xwmin,Ywmax,Xwmax,Ywmax 3. Calculate the values of parameters pi and qi P1= - X ; P2= X; q1=X1-Xwmin q2=Xwmax-X1 q3=Y1-Ywmin q4=Ywmax-Y1
P3= - Y; P4= Y;
4. If pi=0; then line is parallel to the first boundary { If Qi<0 { Line is completely outside the boundary so, discard the line segment stop }
DEEPTI PATEL
Else { Check if LINE IS HORIZONTAL OR VERTICAL checks the line end points with corresponding boundaries. } } 5. Initialize the values t1 and t2 T1=0 and t2=1 6. Calculate the values for qi/pi where i=1,2,3,4 7. Select the values of qi/pi ,where pi<0 and assigning the maximum value of qi/pi to t1 8. Select the values of qi/pi ,where pi>0 and assigning the minimum value of qi/pi to t2 9. If T1<T2 { X1=X1+t1* X X2=X2+t2* X Y1=Y1+t1* Y Y2=Y2+t2* Y } Draw the line joining the end points 10. Stop
DEEPTI PATEL
Example:
A line having end points (10, 10) (60, 30) is to be clipping against the clip window co-ordinates having (15, 15) & (25, 25)
X1=10
X2=60
Y1=10 Y2=30
Step :4
T1=0
T2=1
DEEPTI PATEL
Step :5
P1 & p3 <0 so value is 1/10 and we can take maximum for t1=1/4 P2 & p4>0 so value is 3/10 & we can take minimum for t2=3/10 t1<t2 (1/4<3/10)
Answer::
Definition:: 1. Translation :: One object is moved its original co-ordinates to different coordinates
2. Rotation:: Rotation is applied to an object by repositioning it along circular path in X,Y plan
DEEPTI PATEL
Uniform Scaling
1 If scaling Sx=Sy then we says that it is uniform scaling Object shape both the x as well as y remains same
Differential Scaling
If Sx # Sy then it is called as differential scaling Object height and width may different
EX: Sx=2,Sy=2
Ex: Sx=0.5,Sy=2
DEEPTI PATEL
4. Viewing Transformation :: Displaying an image of a picture involves mapping the co-ordinates of points and lines that form the picture into an appropriate physical device co-ordinates where the image is to be displayed this mapping of co-ordinates is called viewing transformation.
5. Window code:: The world co-ordinates system is mapped into finite world co-ordinates area for display called window code
6. View port:: An area on the device to which window is mapped is called view port.
7. Work station transformation:: Transformation of window port to view port is also known as work station transformation.
DEEPTI PATEL
7. If D.n >0 TL= (-w.n/d.n) Else Tu=(-w.n/d.n) 8. Repeat step 4 to 7 for each edge of clipping window 9. Find maximum lower limit of t and minimum upper limit of t 10.If maximum lower limit>minimum upper limit then ignore the line else find the intersection point p(t)=p+(q-p)t Example:: Clip a line (5, 50) and (40, 30) against the clipping window (10, 10) and (30, 40)
DEEPTI PATEL
Step ::1
DEEPTI PATEL
Step ::2
Step ::3
DEEPTI PATEL
Step ::4
Pt=p+(q-p) * t(max)
Pt=p+(q-p) * t(min)
DEEPTI PATEL
UNIT 4:: Three Dimensional Object Representation and Three Dimensional Geometric and Modeling Transformations Spline Representations::
o Smooth curve defined by some control points moving the control points changes the curve o A spline curve is specified using a set of control points o There are two ways to fit a curve to these points: Interpolation - the curve passes through all of the control points Approximation - the curve does not pass through all of the control points
The animation last 10 seconds and key frame are to be computed at 1 second intervals find out the position of the car on the road at the start of 6th second of the animation.
DEEPTI PATEL
= x0(1-u)3 + 3x1 u(1-u)2 + 3x2 u2(1-u) + x3u3 = 0(1-0.6)3 + 3(5)(0.6)(1-0.6)2 + 3(40)(0.6)2(1-0.6) + (50)(0.6)3 = 0 + 1.44 + 17.28 + 10.8 X (0.6) = 29.52 Y (u): =y1(1-u)3 + 3y1 u(1-1)2 + 3y2 u2(1-u) + y3u3 =0(1-0.6)3 + 3(40)(0.6)(1-0.6)2 +3(5)(0.6)2(1-0.6) + 15(0.6)3 =0 + 11.52 + 2.16 + 3.24 Y (0.6) = 16.92
Transformations:
1. Translation 2. Rotation 3. Scaling
Translation : Translation refers to moving or displacing for a certain distance in space. In 3D, the matrix used for translation has the form
DEEPTI PATEL
1 0 0 a
0 1 0 b
0 0 1 c
0 0 0 1
where (a, b, c) is the vector that defines the direction and distance to move.
Rotation
Rotation refers to rotating vertices about an axis going through the origin. Three such axes are the X, Y, and Z axes in the space.
cos 0 sin 0
0 -sin 1 0 0 cos 0 0
0 0 0 1
Scaling
Scaling refers to enlarging or shrinking the size of vector components along axis directions. For example, a vector can be scaled up along all directions or scaled down along the X axis only. To scale, we usually apply the scaling matrix below: p 0 0 0 0 q 0 0 0 0 0 0 r 0 0 1
Where p, q, and r are the scaling factor along the X, Y, and Z direction, respectively.
DEEPTI PATEL
DEEPTI PATEL
Classification of Animation::
o o
Interactive Multimedia and Non Interactive Multimedia Entertainment Multimedia and Edutainment Multimedia