0% found this document useful (0 votes)
56 views

Veda File-2

Uploaded by

Prayush Shah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Veda File-2

Uploaded by

Prayush Shah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 121

Computer Graphics Assignments

Assignment 1
1) Consider three different raster systems with resolutions of 640 by 480, 1280 by
1024. What size frame buffer (in bytes) is needed for each of this system to
store 12 bits per pixel?
2) Suppose an RGB raster system is to be designed using an 8 inch by 10-inch
screen with a resolution of 100 pixels per inch in each direction. If we want to
store 6 bits per pixel in the frame buffer, how much storage (in bytes) do we
need for the frame buffer?
3) How long would it take to load a 640 by 480 frame buffer with 12 bits per pixel,
if 105 bits can be transferred per second? How much would it take to load a 24
bit per pixel frame buffer with a resolution of 1280 by 1024 using this same
transfer rate?
4) How long would it take to load a (640×480) frame buffer with 12-bit per pixel,
if 105bits can be transferred per second? How long would it take to load a 24 –
bit per pixel frame buffer with a resolution of 1280 by 1024 using the same
transfer rate?
5) Consider two raster systems with resolutions of (640×480) and (1280 by 1024).
How many pixels could be accessed per second in each of these systems by a
display controller that refreshes the screen at a rate of 60 frames per second?
What is the access time per pixel in each system?
6) How much time is spent scanning across each row of pixels during screen
refresh on a raster system with a resolution of 1280 by 1024 and a refresh rate
of 60 frames per second?
7) What is the size of frame buffer required to store a SVGA with 24-bit true color
video of 10 minutes without compression?
8) Suppose an RGB raster system is to be designed using an 8 inch by 10-inch
screen with a resolution of 100 pixels per inch in each direction. How long
would it take to load this raster system in frame buffer with 24 bits per pixel, if
105 bits can be transferred per second?
9) Compare and contrast Raster- scan Display with Random-scan Display.

Prepared By: Bal Krishna Nyaupane CG: Assignments 1


Computer Graphics Assignments
Assignment 2
1) Digitize the line (40, 65) to (50, 50) using DDA line drawing algorithm.
2) Digitize the line (20, 35) to (30, 43) using DDA line drawing algorithm.
3) Digitize the line (50, 55) to (35, 45) using Bresenham’s line drawing algorithm.
4) Digitize the line (60, 35) to (45, 45) using Bresenham’s line drawing algorithm.
5) Write a general algorithm of Bresenham’s line drawing algorithm. [ positive and
negative slope for m >1 and m ≤ 1]
6) Derive the Bresenham’s decision parameter to draw a line with negative slope
and m>1.
7) Derive the Bresenham’s decision parameter to draw a line moving from left to
right and having negative slope.
8) Derive the Mid-point circle decision parameter with starting point (-r, 0) and
moving in clock wise direction.
9) Derive the Mid-point circle decision parameter with starting point (0, -r) and
moving in clock wise direction.
10) Derive decision parameter for midpoint circle algorithm assuming the
start position as (r, 0) points are to be generated along the curve path in counter
clockwise direction.
11) Digitize the circle with radius 12 and center (15,22).
12) Digitize the circle with radius 10 and center (5,2).
13) Digitize the Ellipse with radius Rx = 8 and Ry = 12 and center (10,20).
14) Digitize the Ellipse with radius Rx = 12 and Ry = 7 and center (19,10).

Prepared By: Bal Krishna Nyaupane CG: Assignments 1


Computer Graphics Assignments
Assignment 3
1) Develop the matrix to reflect an object about the line y=mx+b.
2) How would you reflect an object about a line y=3x+10? Explain the steps with
the matrices.
3) Reflect the triangle with vertices A (4, 12), B (6, 15), and C (2, 10) about the
line y=4x+2. And draw the final triangle.
4) Suppose a rectangular window has lower left corner at L (8, 9) & upper right
corners at R (14, 13). Use Cohen Sutherland algorithm to clip the line with the
end points A (7, 8) & B (13, 14) against above provided window.
5) Develop the complete matrix to reflect an object with the reference line y= -x.
6) Use Cohen Sutherland’s line clipping algorithm to clip a line starting from (-10,
5) and ending at (20, 10) against the window having its lower left corner at (-5, -
5) and upper right corner at (15, 12).
7) Use Liang-Barsky line clipping algorithm to clip a line starting from (10, 25)
and ending at (100, 95) against the window having its lower left corner at (20,
20) and upper right corner at (80, 90).
8) Use Liang-Barsky line clipping algorithm to clip a line starting from (2, -5) and
ending at (12,28) against the window having its lower left corner at (3, 10) and
upper right corner at (15, 25).
9) Find the transformation matrix that transforms the square ABCD whose center
is at (2,2) is reduced to half, with center still remaining at (2,2). The coordinate
of the square ABCD are A (0,0), B (0,4), C (4,4) and D (4,0). Find the
coordinates of new squares.
10) Magnify the triangle with vertices A (0,0), B (1,1), and C (5,2) to twice its size
while keeping C (5,2) fixed.
11) A mirror is placed vertically such that is passes through the points (10,0), and
(0,10). Find the reflected view of triangle ABC with coordinates A (5,50), B
(20,40), and C (10,70).
12) Suppose there is a rectangle ABCD whose coordinates are A (1,1), B (4,1), C
(4,4) and D (1,4) and the window coordinates are (2,2), (5,2),(5,5), and (2,5)
and the given viewport location is(0.5,0),(1,0),(1,0.5), and (0.5,0.5). Calculate
the viewing transformation matrix.
13) Suppose there is a square ABCD whose coordinates are A (0,0), B (0,1), C (1,1)
and D (1,0).

Prepared By: Bal Krishna Nyaupane CG: Assignments 1


a. Shear the square relative to the Xref =-1 and Shy = 2. Calculate the final
coordinates and draw it.
b. Shear the square relative to the Yref =-1 and Shx = 1. Calculate the final
coordinates and draw it.

Prepared By: Bal Krishna Nyaupane CG: Assignments 2


Computer Graphics Assignments
Assignment 4
1) If you have three coordinates (x1, y1, z1), (x2, y2, z2) and (x3, y3, z3), then
how do you find the coefficient of surface normal N (A, B, C)?
2) Perform rotation of a triangle with vertices (10,10,10), (20,20,15) and
(15,15,30) about z axis with 90 degree in counter clock wise direction.
3) Develop a matrix to rotate an object about an axis that is not parallel to the
coordinate axis with necessary figures and steps.
4) Perform rotation of a rectangle with vertices (10,10,10), (20,10,20), (20,20,20)
and (10,20,10) about y- axis with 45-degree in counter clock wise direction.
5) Perform rotation of a line with vertices (10,10,10), and (20,20,20) about y- axis
with 45-degree in clock wise direction.
6) Find the new coordinates of a unit cube 900 rotated about an axis defined by a
line (5,4,0) and (6,6,2) and draw the final cube.
7) A unit length cube with a diagonal passing through (0,0,0) and (1,1,1) is shared
with respect to YZ-plane with the shear constant=2 in both directions. Obtain
the coordinates of all the corners of the cube after shear.
8) Develop the complete 3-Dimensional World-coordinate to View-coordinate
transformation matrix.
9) A 3D scene is viewed from point (1,1,1) with camera orientation described by
the orientation of three orthogonal vectors (1,1,1), (1,2, -3) and (-5,4,1). Obtain
transformation matrix to describe the scene with respect to camera orientation.
10) Develop the 3-Dimensional World-coordinate to View-coordinate
transformation matrix to describe the following scenarios
a. View-reference Point or Eye position P0= (3,1,3)
b. Look-at-point Pref= (2,1,2)
c. View-up Vector V= (0,1,0)
11) Obtain perspective projection co-ordinates for the pyramid with vertices of base
(15,15,10, (20,20,10), (25,15,10), (20,20,10) and apex (20,15,20); given that
Zprp =20 and Zvp = 0.
12) Derive the transformation matrix for rotating any object by 45 degree in counter
clockwise direction about a line passing through the point (20,30,0) and point
(0,30,40).
13) Develop a Matrix to describe the perspective projection of an object in
homogeneous coordinate representation.
14) Derive the matrix for Cubic Bezier curve.

Prepared By: Bal Krishna Nyaupane CG: Assignments 1


15) Why do you Parametric Cubic Curves? Develop the complete Matrix for
Hermite Curve.
16) Find the coordinates at U=0.25, 0.5, and 0.75 with respect to the control points
(10, 10), (15, 25), (20, 30), and (25, 5) using Bezier function. Draw your curve
with given control points.

Prepared By: Bal Krishna Nyaupane CG: Assignments 2

You might also like