21-22 18CS62 Kjrpia1
21-22 18CS62 Kjrpia1
21-22 18CS62 Kjrpia1
OR
List and explain various openGL primitive and its attribute functions. Write an
Q2 10 L3 CO1
openGL code to create human face like structure using suitable openGL
primitive functions
Q3 (a)Define the following terms with respect to computer graphics 4+6 L2,L CO1
(i)bitmap (ii) pixmap(iii) aspect ratio (iv) frame buffer 3
OR
Given circle radius r=10,solve midpoint circle generation algorithm by
Q10 determining positions along the circle octant in the first quadrant from x=0 to L3 CO1
x=y.
2M
1. #include<GL/glut.h>
2. Configure and open window
3. Initialize openGL state,program variables etc
Register callback,resize,display,KB,mouse etc 3M
OR
RAO BAHADUR Y. MAHABALESWARAPPA ENGINEERING COLLEGE, BELLARY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Q2 Primitives CO1
L3
4M
Attribute functions
glPointSize(),glLineWidth(),glLineStripple(),glPolygonStripple() 3M
Program to create human face like structure
3M
Q3 (a)Define the following terms with respect to computer graphics L2 CO1
(i)bitmap:balck and white system-one pixel 1M
(ii) pixmap:multiple bits/pixel each
(iii) aspect ratio: width to height
(iv) frame buffer:picture definition stored in a memory
1M each step
OR
Q4 Write an openGL program to draw the following geometric objects with 3+4+3 L3 CO1
suitable openGL primitives.
RAO BAHADUR Y. MAHABALESWARAPPA ENGINEERING COLLEGE, BELLARY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Explain Bresenham line drawing algorithm with suitable derivation
Q5 Algorithm: 10 L2 CO1
Step1: Start
Step2: Declare x1, y1, x2, y2.
Step3: Calculate dx = x2 - x1
Dy = y2 - y1 --------------------------------
2M
Step 4: Calculate slope, m = dy / dx.
Step5: For m < 1: Calculate initial decision variable: P = 2dy - dx.
Step6: while (x1 <= x2)
if(P < 0):
xk = xk + 1
P = P + 2dy
yk = yk
3M
else : --------------------------------------------------------------------------
xk = xk + 1
P = P + 2dy - 2dx
yk = yk + 1
Step 7: Plot ( xk , yk )
Step 8: End
Derivation ---------------------------------------------------------------------------------------------------------------- 5M
----------3M
----------------------------1M each