Sunteți pe pagina 1din 5

LABORATORY MANUAL

CS-4508
Computer Graphics & Multimedia

M.Sc. (C.S. ) III Semester


July-December 2009

SCHOOL OF COMPUTER SCIENCE & IT,


DAVV, INDORE

Laboratory Manual: CS-4508 Computer Graphics & Multimedia


(1)
AIM:
The aim of the course is to give students a good understanding of basic concepts
of computer graphics and the need of developing graphic applications.

OBJECTIVES:
The objectives of the course are to:
• Understand the need of developing graphic applications.
• Learn the hardware involved in building graphic applications.
• Learn algorithmic development of graphic primitives like: line, circle, ellipse,
polygon etc.
• Learn the representation and transformation of graphical images and pictures.
• Learn the concept of Color Generation.

ASSIGNMENTS SCHEDULE:

Week Topic Remark


Week 1 Assignment 1:

1. Write a program to implement DDA algorithm.


2. What are the characteristics of Video Display Devices?
3. Compare and contrast the operating characteristics of Raster Refresh Systems,
Plasma Panels and LCDs.
4. Write application of CG in Education and Training.
5. Compare Refresh type and Storage type CRT display.
6. Write a program to draw the following figure:-
A
0100090000037800000002001c00000000000400000003010800050000000b02000000000
50000000c0291014605040000002e0118001c000000fb021000070000000000bc020000
00000102022253797374656d000146050000798c0000fc5b110004ee8339e84c5f040c02
0000040000002d01000004000000020101001c000000fb02ceff00000000000090010000
00000440001254696d6573204e657720526f6d616e00000000000000000000000000000
00000040000002d010100050000000902000000020d000000320a2d000000010004000
00000004605900120251600040000002d010000030000000000
B
All sides are equal and point A and B is input.

Week 2 Assignment 2:

1. Write a program to implement Bresenham’s line algorithm.


2. What are the advantages of Bresenham’s line algorithm over DDA algorithm.
3. How can the Bresenham's line algorithm be modified to accommodate all
types of lines?
4. Modify the Bresenham’s line algorithm so that it will produce a dashed-line
pattern. Dash length should be independent of slope.
5. Write a program to implement Midpoint circle generating algorithm.

Week Topic Remark

Laboratory Manual: CS-4508 Computer Graphics & Multimedia


(2)
Week 3 Assignment 3:
1. Write a program to implement Bresenham’s circle generating algorithm.
2. Differentiate between Midpoint & Bresenham’s circle generating algorithm.
3. Write short note on different input devices.
4. Write a program to draw the following figure:-

Point A and B is input.


5. Write a program to draw the following figure:-
0100090000037800000002001c00000000000400000003010800050000000b0
200000000050000000c0291014605040000002e0118001c000000fb021000070
000000000bc02000000000102022253797374656d000146050000798c0000fc5
b110004ee8339e84c5f040c020000040000002d01000004000000020101001c0
00000fb02ceff0000000000009001000000000440001254696d6573204e65772
0526f6d616e0000000000000000000000000000000000040000002d01010005
0000000902000000020d000000320a2d0000000100040000000000460590012
0251600040000002d010000030000000000
Input is radius of circle as r.
Week 4 Test-1
Week 5 Assignment 4:
1. Write a program to implement outline character.
2. Write a program to implement bitmap character.
3. Write a program to implement ellipse generating algorithm
4. Write a program to draw the following figure:-
0100090000037800000002001c00000000000400000003010800050000
000b0200000000050000000c0291014605040000002e0118001c000000f
b021000070000000000bc02000000000102022253797374656d0001460
50000798c0000fc5b110004ee8339e84c5f040c020000040000002d01000
004000000020101001c000000fb02ceff000000000000900100000000044
0001254696d6573204e657720526f6d616e000000000000000000000000
0000000000040000002d010100050000000902000000020d000000320a
2d00000001000400000000004605900120251600040000002d01000003
0000000000
Input is rx, ry and center coordinates.
Week 6 Assignment 5:
1. Write a procedure to scan the interior of a specified ellipse into a solid color.
2. Modify the 4-connected boundary fill algorithm to avoid excess
stacking.
3. Write the Scan line filling algorithm.
Week 7 Assignment 6:
1. Write a short note on viewing transformation.
2. Distinguish between viewport and window.
3. What do you mean by normalization transformation? Why it is needed?
4. Write a program to implement Line Clipping Algorithm using Cohen
Sutherland Algorithm.
5. Write a program to implement Line Clipping Algorithm using Liang Barsky
Algorithm.
Laboratory Manual: CS-4508 Computer Graphics & Multimedia
(3)
6. Explain the Sutherland and Cohen subdivision algorithm for the line clipping.
7. Explain Liang-Barsky line clipping algorithm.

Week Topic Remark


Week 8 Assignment 7:
1. Explain Sutherland-Hodgeman algorithm for polygon clipping.
2. Write a program to Implement Polygon Clipping Algorithm using
Sutherland -Hodgman Algorithm.
3. Modify the Liang-Barsky line clipping algorithm to polygon clipping.
4. What do you mean by interior and exterior clipping?
5. Explain how exterior clipping is useful in multiple window environments.

Week 9 Test-2
Week 10 Assignment 8:
1. Write a program to implement scaling on polygon.
2. Write a program to implement transferring on polygon.
3. Write a program to implement rotation on polygon.
4. Write a program to implement reflection on polygon.
5. Write a Program to implement set of Basic Transformations on Polygon i.e.
Translation,Rotation and Scaling.

Week 11 Assignment 9:
1. Why are matrices used for implementing transformations?
2. What is the significance of homogeneous co-ordinates? Give the homogeneous
co-ordinates for the basic transformations.
3. Write a program to implement set of Composite Transformations on Polygon
i.e Reflection,Shear (X &Y), rotation about an arbitrary point.
4. Derive the transformation matrix for rotation about an arbitrary axis.
5. Derive the transformation matrix for rotation about an arbitrary plane.

Week 12 Assignment 10:


1. Find a transformation of triangle (coordinates will be given) by Rotating 45
degree about the origin and then translating one unit in X and Y direction.
2. Derived transformation matrix for the following figure.
0100090000037800000002001c00000000000400000003010800050000000b02000000
00050000000c0291014605040000002e0118001c000000fb021000070000000000bc020
00000000102022253797374656d000146050000798c0000fc5b110004ee8339e84c5f040
c020000040000002d01000004000000020101001c000000fb02ceff00000000000090010
00000000440001254696d6573204e657720526f6d616e00000000000000000000000000
00000000040000002d010100050000000902000000020d000000320a2d000000010004
00000000004605900120251600040000002d010000030000000000
A B

3. Determine the sequence of basic transformations that are equivalent to the x-


direction and y-direction shearing matrix.
4. Show that two successive reflections about any line passing through the
coordinate origin is equivalent to single rotation about the origin.
5. Show that transformation matrix for a reflection about the line y=x, is
equivalent to a reflection relative to the x axis followed by a counterclockwise
rotation of 90 degrees.

Laboratory Manual: CS-4508 Computer Graphics & Multimedia


(4)
Week Topic Remark
Week 13 Assignment 11:
1. Problems on 3-Dimension transformation.
2. What are different types of projection? Derive a matrix representation
for perspective transformation? What are different perspective
anomalies?

Week 14 Test-3

Resources:
• Donald Hearn, M. Pauline Baker,Computer Graphics, C version, 2 edition Prentice-
Hall.
• Zhigang Xiang, Roy A. Plastock,Schaum's outline of Theory and Problems of
computer graphics, 2 edition, McGraw-Hill.
• James D. Foley , Andries van Dam , Steven K. Feiner , John F. Hughes, Computer
Graphics: Principles and Practice in C , 2 edition, Addison-Wesley Professional.

Laboratory Manual: CS-4508 Computer Graphics & Multimedia


(5)

S-ar putea să vă placă și