Sunteți pe pagina 1din 7

ASSIGNMENT

NO 4
Computer
Graphics
CSE (405)
Submitted to : Submitted
By:
Miss Shamli Baljeet Kaur
Roll no 15
Section B1802
PART – A

Ques1 :Given points P1(1,2,0), P2(3,6,20) and P3(2,4,6) and a viewpoint C(0,0,-10)
determine which points obscure the others when viewed from C.
Solution: The line joining the viewpoint C(0,0,-10) and point P1(1,2,0) is
x=t , y = 2t z = -10+10t

(i)Firstly determine whether P2(3,6,20) lies on this line .

We see that x=3 when t = 3 ,and then t = 3 ,x = 3 , y = 6 ,and z = 20 .So P2 lies on the projection
line through C and P1.
.
(ii)Next we determine which point is in front with respect to C .Now C occurs on the line at t =
0, P1 occurs at t =1,and P2 occurs at t = 3 .Thus comparing t values P1 is in frint of P2 with
respect to C that is P1 obsures P2

(iii)We now determines whether P3( 2 ,4 , 6) is not on this projection line and so it neither
obsures nor is obsured by P1 and P2

Ques2 :How does the scan line method determines which surfaces are hidden?
Explain with the help of example
Ans: The basic scan-line method looks one at a time at each of the horizontal lines of pixels in
the display area.

For Example :
At the horizontal pixel line y = α,the graphics data structure (consisted of all scan – converted
polygons)is searched to find all p[olygons with any horizontal (y)pixels values equal to α
Next the algorithm looks at each individual pixels in the a row .At pixel (a,b)the depth values (z
values)of each polygon found above are compared to find the polygon having the smallest z
value at this pixel .The color of pixel (a,b)is the set to the color of the corresponding polygons at
this pixel .

Ques 3 Construct enough points on bezier curve where central points are
P0(4,2),p1(8,8) and P2(16,4) to draw the accurate sketch. What are the
coordinates at u=0.5..

Solution: A cubic Bezier curve is simply described by four ordered control points, p0,
p1, p2, and p3. It is easy enough to say that the curve should "bend towards" the
points. It has three general properties:

1. The curve interpolates the endpoints: we want the curve to start at p0 and end at p3.
2. The control points have local control: we'd like the curve near a control point to
move when we move the control point, but have the rest of the curve not move as
much.
3. The curve stays within the convex hull of the control points. It can be culled against
quickly for visibility culling or hit testing.

A set of functions, called the Bernstein basis functions, satisfy the three general
properties of cubic Bezier curves.
PART – B

Ques4 Derive the perspective projection onto the view plane z=d where the
center of projection is the origin(0,0,0)
Solution: The plane z = d is parallel to the xy plane .Thus the view plane
normal vector N is the same as the normal vector K to the xy plane that
is ,N = K .Choosing the view reference point as Ro(0,0,d)
Then after that we identify parameters
N (n1,n2,n3) = ( 0,0,1) Ro ( xo ,yo,zo) = ( 0,0 d)
So
Do – n1xo + n2yo+ n3zo = d

And then the projection matrix is

Per K,R =
d 0 0 0
0 d 0 0
0 0 d 0
0 0 1 0
Ques 5 Derive the equations of parallel projection onto the xy plane in the
direction of projection V=aI+bJ+cK.
Ans:

V=ai+bj+ck

P(x,y,z)

P(x’,y’,0)

Fron according to the figure we see that the vectors V and


PP’ have the same direction .This means that PP’=kV .
Comparing componenets ,we see that
X’ – x = ka y’ – y = kb z’ – z = kc

So k = - z / c x’ = x – a z /c and y’ = y – bz / c

In 3 x 3 matrix from this is


Parv =
1 0 0
0 1 0
-a/c -b/c 0
And so P’ = P . P arv

Ques 6What two steps are required to determine whether any given point
P1(x1,y1,z1) obscures another point P2(x2,y2,z2)?

P2(x2,y2,z2)

P1(x1,y1,z1)

Solution : It must be determined


(i)Whether the two points lie on the same projection line

(ii)If they lie on the same projection line then chjeck whicj point is in the front of the
other

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