Graphics Numericals

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Section A: Numerical Problems on

Graphics Primitives and Transformations


(40 Marks)

Each question carries 8 marks. Answer any


five questions.
1.Line Drawing Using Bresenham's
Algorithm:

o Use Bresenham’s line drawing


algorithm to draw a line from (2, 3) to
(10, 7). Show all calculations and
intermediate steps.

2.Circle Drawing Using Midpoint


Algorithm:

o Apply the midpoint circle algorithm to


draw a circle with a center at (5, 5) and
a radius of 6. Provide the first eight
points generated and the reflections in
all octants.

3.2D Translation:

o Translate a triangle with vertices A(1,


2), B(4, 3), and C(3, 5) by 3 units
along the x-axis and 2 units along the
y-axis. Provide the new coordinates of
the vertices.

4.2D Rotation:

o Rotate a point P(3, 4) by 45 degrees


about the origin. Use the rotation
matrix and provide the new
coordinates of the point. Assume
counter-clockwise rotation.
5.2D Scaling:

o Scale a rectangle defined by the points


A(2, 2), B(6, 2), C(6, 4), and D(2, 4)
by a factor of 2 along the x-axis and 3
along the y-axis. Provide the new
coordinates of the rectangle.

6.3D Translation:

o Translate a point P(2, -3, 4) by 3 units


along the x-axis, -2 units along the y-
axis, and 5 units along the z-axis.
Provide the new coordinates of the
point.

7.3D Rotation About Arbitrary Axis:


o Rotate a point P(3, 4, 5) by 60 degrees

around the axis defined by the vector


v=(1,1,0)\mathbf{v} = (1, 1,
0)v=(1,1,0). Use the appropriate
rotation matrix and provide the new
coordinates of the point. Simplify to a
reasonable degree.

Section B: Numerical Problems on


Clipping, Curves, and Shading (60 Marks)
Each question carries 10 marks. Answer
any six questions.
1.Cohen-Sutherland Line Clipping
Algorithm:

o Use the Cohen-Sutherland algorithm to


clip a line segment from P1(5, 5) to
P2(15, 15) against a clipping window
defined by x_min = 0, x_max = 10,
y_min = 0, y_max = 10. Provide the
clipped line segment coordinates.
2.Polygon Clipping Using Sutherland-
Hodgman Algorithm:

o Clip a polygon with vertices A(1, 1),


B(9, 2), C(8, 8), D(2, 9) against a
rectangular clipping window defined
by x_min = 2, x_max = 7, y_min = 2,
y_max = 7. Provide the vertices of the
clipped polygon.

3.Bezier Curve Calculation:


o Calculate the coordinates of a Bezier

curve at t = 0.5 for control points P0(1,


1), P1(2, 3), P2(4, 3), and P3(3, 1). Use
the Bezier curve formula and show all
steps.

4.B-spline Curve Calculation:

o Determine the coordinates of a B-


spline curve at t = 0.5 for control
points P0(1, 2), P1(2, 4), P2(4, 3), and
P3(5, 2) using a quadratic B-spline
basis function.

5.Z-Buffer Algorithm:
o For a 3D scene, you have two triangles

defined by vertices T1: A(1, 1, 5), B(2,


2, 4), C(3, 1, 3) and T2: D(1, 1, 3),
E(2, 2, 2), F(3, 1, 1). Use the Z-buffer
algorithm to determine which triangle's
color would be displayed at point (2, 1)
on the screen. Show your calculations.

6.Texture Mapping:

o A texture map is to be applied to a


rectangle with vertices A(1, 1), B(4, 1),
C(4, 3), and D(1, 3). The texture
coordinates are TA(0, 0), TB(1, 0),
TC(1, 1), and TD(0, 1). Determine the
texture coordinates for a point P(2, 2)
inside the rectangle.
7.Gouraud Shading:

o Given a triangle with vertices A(1, 2,


1) with color intensity 0.2, B(4, 6, 1)
with color intensity 0.8, and C(7, 3, 1)
with color intensity 0.5, use Gouraud
shading to determine the color
intensity at a point P(4, 4, 1) inside the
triangle. Assume linear interpolation.

8.Phong Shading:

o For a point P on a surface, given the


normal vector N=(0,0,1)\mathbf{N} =
(0, 0, 1)N=(0,0,1), light direction
L=(1,1,1)\mathbf{L} = (1, 1,
1)L=(1,1,1), view direction
V=(0,0,1)\mathbf{V} = (0, 0,
1)V=(0,0,1), and reflection coefficient
ks=0.5k_s = 0.5ks=0.5, calculate the
intensity of reflected light using the
Phong reflection model. Assume
shininess factor n=10n = 10n=10 and
an ambient light intensity Ia=0.1I_a =
0.1Ia=0.1.

9.Reflection About Arbitrary Plane:

o Reflect a point P(3, 4, 5) about the


plane defined by x+y+z=1x + y + z =
1x+y+z=1. Provide the new
coordinates of the reflected point.

10. Perspective Projection:

o Calculate the perspective projection of


a point P(3, 4, 5) onto the plane z = 0
from a viewpoint at (0,0,10)(0, 0,
10)(0,0,10). Use the perspective
projection formula.

You might also like