0% found this document useful (0 votes)
12 views7 pages

Cgi Ans

Uploaded by

dheeraj g
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

Cgi Ans

Uploaded by

dheeraj g
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1a.

crt

2A.DISPLAY WINDOW MANAGEMENT

Display-Window Management Using GLUT

✓ We can consider a simplified example, minimal number of operations for displaying a picture.

Step 1: initialization of GLUT

 We are using the OpenGL Utility Toolkit, our first step is to initialize GLUT.

 This initialization function could also process any command line arguments, but we will not need to
use these parameters for our first example programs.

 We perform the GLUT initialization with the statement glutInit (&argc, argv);
Step 2: title

 We can state that a display window is to be created on the screen with a given caption for the title
bar. This is accomplished with the function glutCreateWindow ("An Example OpenGL Program");

 where the single argument for this function can be any character string that we want to use for
the display-window title.

Step 3: Specification of the display window

 Then we need to specify what the display window is to contain.

 For this, we create a picture using OpenGL functions and pass the picture definition to the GLUT
routine glutDisplayFunc, which assigns our picture to the display window.

 Example: suppose we have the OpenGL code for describing a line segment in a procedure called
lineSegment.

 Then the following function call passes the line-segment description to the display window:
glutDisplayFunc (lineSegment);

Step 4: one more GLUT function

 But the display window is not yet on the screen.

 We need one more GLUT function to complete the window-processing operations.

 After execution of the following statement, all display windows that we have created, including
their graphic content, are now activated: glutMainLoop ( );

 This function must be the last one in our program. It displays the initial graphics and puts the
program into an infinite loop that checks for input from devices such as a mouse or keyboard.

Step 5: these parameters using additional GLUT functions

 Although the display window that we created will be in some default location and size, we can set
these parameters using additional GLUT functions.

2B.
3A. DDA LINE ALGORITHM
3B. BRESENHAM LINE ALGORITHM

4A.2D GEOMETRICTRANSFORMATIONS
4B.

REFELECTION

REST REFLECTION PG NO:18 M2

SHEARING:22

You might also like