Department of Information Technology

DEPARTMENT OF INFORMATION TECHNOLOGY

III B.Tech II Semester

Handbook

For

COMPUTER GRAPHICS

Faculty: Mrs. SWATHI AGARWAL

DEPARTMENT OF INFORMATION TECHNOLOGY

III B.Tech II SEM (2014-2015)

COMPUTER GRAPHICS

UNIT-I

Syllabus:

Introduction to Computer Graphics: Application areas of Computer Graphics, Elements of Pictures created in Computer Graphics, Graphics Display Devices, Graphics Input Primitives and Devices.

Drawing Figures: Making Pictures, Drawing Basic Graphics Primitives, Making Line Drawings, Simple Interaction with the Mouse and Key board.

Objectives: To acquire knowledge on basic elements of graphics.

Lecture plan:

S.No / Topic / Date / No. of lectures
1 / Application areas of Computer Graphics / 2
2 / Elements of Pictures created in Computer Graphics / 2
3 / Graphics Display Devices / 1
4 / Graphics Input Primitives and Devices / 2
5 / Making Pictures / 1
6 / Drawing Basic Graphics Primitives / 1
7 / Making Line Drawings / 1
8 / Simple Interaction with the Mouse and Key board / 1
Test / 1
Total / 12

Assignment questions:

1. / a. Illustrate various applications of computer graphics used in real world.
b. Briefly outline the advantage of openGL software of graphics.
2. / a. Outline various output primitives used to create a picture in graphics in open gal.
b. Explain various graphics display devices available to plot a picture.
3. / a. Write various graphics input primitives and devices.
b. Write a short notes on:-
1.  Device independent programming and openGL
2.  Windows based programming
3.  Line drawings in openGL
4.  openGL data types
5.  Interaction with mouse and keyboard
4. / Design an algorithm for drawing the sierpinski gasket and write the opengl function to render the image.
5. / a. Design an application for the illustration of menus in opengl.
b. Outline the different kinds of controls available in GLUI menus.
6. / Write an Open GL program for a 2 – D Sierpinski gasket using mid – point of each of triangle. Indicate the assumptions made in generating the above.
7. / What are the various classes of logical input devices that are supported by open GL? Explain the functionality of each of these classes.
8. / Enlist the various features that a good interactive program should include.
9. / Explain the OpenGL features for graphics programming.

Case Study:

1. / Pseudorandom Clouds of Dots
2. / How to build and run mazes
3. / Building and Using Polyline Files

UNIT-II

Syllabus:

Drawing Tools: Introduction, World Windows and Viewports, Clipping Lines, Developing the Canvas Class, Relative Drawing, and Figures Based on Regular Polygons, Drawing Circles and Arcs, Using the Parametric Form of a Curve.

Vector Tools for Graphics: Introduction, Review of Vectors, the Dot Product, the Cross Product of Two Vectors, Representations of Key Geometric Objects, Finding the Intersection of Two Line Segments, Intersections of Lines with Planes, and Clipping.

Objectives:

1.  To understand different drawing and vector tools for graphics.

Lecture plan:

S.No / Topic / Date / No. of
lectures
1 / Introduction, World Windows and Viewports / 1
2 / Clipping Lines / 2
3 / Developing the Canvas Class / 1
4 / Relative Drawing Based on Regular Polygons / 1
5 / Drawing Circles and Arcs / 1
6 / Using the Parametric Form of a Curve / 1
7 / Introduction, Review of Vectors / 1
8 / The Dot Product / 1
9 / The Cross Product of Two Vectors / 1
10 / Representations of Key Geometric Objects / 1
11 / Finding the Intersection of Two Line Segments / 1
12 / Intersections of Lines with Planes, and Clipping / 1
Test / 2
Total / 15

Assignment questions:

1. / a. Summarize the steps for mapping from the window to viewport.
b. Using window to viewport formulation find the values of A,B,C,D for window(w.l,w.r,w.b,w.t)=(0,2.0,0,1.0) and viewport(v.l,v.r,v.b,v.t)=(40,400,60,300)
2. / Explain cohen-sutherland line clipping algorithm. For the given window by(left,right,bottom,top)=(30,220,50,240) and the following line segments:
1.  A(40,140) , B(100,200)
2.  C(10,270) , B(300,0)
3.  A(20,10) , B(20,200)
4.  A(0,0) , B(250,250)
Determine the endpoints of the clipped segment.
3. / Explain and sketch the code for drawing a rosette.
4. / Write a short notes on:-
1.  Parametric form for a curve.
2.  Cross and Dot product of vectors.
5. / a. Find when and where the ray A + ct hits the object n. (P-B) = 0 (lines in the 2d or planes in 3D).
i. A= (2,3), c = (4, -4), n= (6,8), B=(7,7)
ii. A= (2-4,3), c = (4, 0,-4), n= (6,9,9), B=(-7,2,7)
b. Find the point where the ray (1,5,2) + (5,-2,6)t hits the plane 2x-4y+z=8.
6. / Outline the code and algorithm for Cyrus-Beck Clipping Algorithm.
7. / Write notes on the following:
i. glViewport( )
ii. glVertex2f( )
iit.glCoIor3f()
iv.g!F!ush()

Case Study:

1. / Implementation of the Cohen-Sutherland Clipper in C/C++ and Cyrus-Beck Clipping
2. / Animation with Tweening

UNIT-III

Syllabus:

Transformations of Objects: Introduction, Introduction to Transformations, 3D Affine Transformations, Changing Coordinate Systems, Using Affine Transformations in a Program, Drawing 3D Scenes with OpenGL.

Modeling Shapes with Polygonal Meshes: Introduction, Introduction to Solid Modeling with Polygonal Meshes, Polyhedra.

.

Objectives: To study 3D Affine Transformations and modeling shapes with polygonal meshes.

Lecture plan:

S.No / Topic / Date / No. of lectures
1 / Introduction to Transformations / 2
2 / 3D Affine Transformations / 2
3 / Changing Coordinate Systems / 1
4 / Using Affine Transformations in a Program / 1
5 / Drawing 3D Scenes with OpenGL / 1
6 / Introduction to Solid Modeling with Polygonal Meshes / 1
7 / Polyhedra / 2
8 / Test / 1
Total / 11

Assignment questions:

1. / a. Write briefly about the properties, disadvantages and advantages of Affine Transformations.
b. Explain how 2D Affine transformations useful in graphics and formulate their representations in matrix form, with an example.
2. / A pure scaling affine transformation uses scale factors Sx = 3 and Sy = -2. Find the image of each of the three objects in Figure 5.12 under this transformation, and sketch them. (Make use of the facts - to be proved later - that an affine transformations maps straight lines to straight lines, and ellipses to ellipses.)
3. / a. Find the image of each of the following points after rotation about the origin:
i. (2,3) through an angle of -45o.
ii. (1,1) through an angle of -180o.
iii. (60,61) through an angle of 4o.
4. / Consider the shear for which g = .4 and h = 0. Experiment with various sets of three collinear points to build some assurance that the sheared points are still collinear. Then, assuming that lines do shear into lines, determine into what objects the following line segments shear:
a. the horizontal segment between ( - 3, 4) and (2, 4);
b. the horizontal segment between ( - 3, - 4) and (2, - 4);
c. the vertical segment between ( - 2, 5) and ( - 2, - 1);
d. the vertical segment between (2, 5) and (2, - 1);
e. the segment between ( - 1, - 2) and (3, 2);
5. / Explain rotation, transformation and scaling, with respect to Two dimensions.
6. / Explain rotation, shear and scaling, with respect to an arbitrary point for Three dimensions.
7. / Outline the procedure for reflection about a tilted line.
8. / Outline the properties of affine transformation.
9. / Discuss the following OpenGL function:
i. gtScaiedO
ii. glTranslatedO
iii.glRotated()
10. / What are Polygonal meshes? Discuss their use in making any graphic object.

Case Study:

1. / Drawing 3D scenes described by SDL
2. / Meshes stored in files.

UNIT-IV

Syllabus:

Three-Dimensional Viewing: Introduction, the Camera Revisited, Building a Camera in a Program, Perspective Projections of 3D Objects, and Taxonomy of Projections.

Rendering Faces for Visual Realism: Introduction, Introduction to Shading Models, Flat Shading and Smooth Shading, Removing Hidden Surfaces, Adding Texture to Faces.

Objectives: To acquire knowledge on three dimensional viewing

Lecture plan:

S.No / Topic / Date / No. of lectures
1 / Introduction / 1
2 / the Camera Revisited / 2
3 / Building a Camera in a Program / 1
4 / Perspective Projections of 3D Objects / 1
5 / Taxonomy of Projections / 1
6 / Introduction to Shading Models / 1
7 / Flat Shading and Smooth Shading / 1
8 / Removing Hidden Surfaces / 1
9 / Adding Texture to Faces / 1
Test / 1
Total / 11

Assignment questions:

1. / a) Discuss the production of stereo views.
b) What are shading models? Also discuss difference between flat shading and smooth shading.
2. / a) Discuss the following OpenGL functions:
i. gluLookAt( )
ii. gluPerspective( )
b) Discuss the creation of a light source in OpenGL.
3. / Explain the Z-Buffer method of Hidden Surface removal.
4. / Discuss the Illumination and shading models for polygons.
5. / Briefly explain the orthographic viewing with open GL functions for 2D & 3D and viewing. Indicate the significance of projection plane and the viewing point in this.
6. / Explain the complete procedure of converting a world object frame into camera or eye frame, using the model view matrix.
7. / Briefly discuss the following along with the functions used for the purpose in openGL.
i) Perspective projections
ii) Orthogonal projections
8. / a. Explain the Phong lighting model. Indicate the advantages and disadvantages of this model.
b. What are the different methods available for shading a polygon? Briefly discuss any two of them.

Case Study:

1 / Flying a Camera through a scene
2 /

Creating shaded objects using OpenGL

UNIT-V

Syllabus:

Curve and Surface Design : Introduction, Describing Curves b y Means of Polynomials, On Interactive Curve Design, Bezier Curves for Curve Design, Properties of Bezier Curves, Finding Better Blending Functions, The B-Spline Basis Functions, Useful Properties of B-Spline Curves for Design, Rational Splines and NURBS Curves, A glimpse a t Interpolation, Modeling Curved Surfaces.

Objectives: To study B-Spline basis functions, Bezier curves and their properties

Lecture plan:

S.No / Topic / Date / No. of lectures
1 / Introduction
2 / Describing Curves b y Means of Polynomials / 1
3 / On Interactive Curve Design / 1
4 / Bezier Curves for Curve Design / 1
5 / Properties of Bezier Curves / 1
6 / Finding Better Blending Functions / 1
7 / The B-Spline Basis Functions / 1
8 / Useful Properties of B-Spline Curves for Design / 1
9 / Rational Splines and NURBS Curves / 1
10 / A glimpse a t Interpolation / 1
11 / Modeling Curved Surfaces / 1
Test / 1
Total / 11

Assignment questions:

1. / What is parametric curve? Describe curves by means of polynomials.
2. / Discuss B-Spline curve and its useful function.
3. / Find the equation of the Bezier curve that passes through (0, 0) and (4, 2) and controlled through (14, 10) and (4, 0).
4. / What are B-spline curves? Explain briefly mentioning a few of their properties.
5. / Enumerate the major differences between Bezier curve, B- spline curves and B- spline curve-NURBS.
6. / Mention any fourproperties of B-spline curves.
7. / Explain briefly about Blending Functions
8. / Explain how to generate a Bezier Curve using the blending functions.

Case Study:

1. / Bezier Curves
2. /

Implementing shadows in a ray tracer

Text Book:

1.  Computer Graphics Using OpenGL, Francis S.Hill Jr. Stephen M Kelley, 3rd edition. Prentice Hall.

References:

1.  Computer Graphics C Version, Donald Hearn and M.Pauline Baker Pearson Education.

2.  Computer Graphics Principles and Practice C.foley, VanDam, Feiner and Hughes, Pearson Education.