21CS63 Computer Graphics and Fundamentals of Image Processing
21CS63 Computer Graphics and Fundamentals of Image Processing
MARK
Solution
S
1 (a) 10 M
Typically examples of data plots are line graphs, bar charts, pie charts,
surface graphs, contour plots and other displays showing relationships
between multiple parameters in two dimensions, three dimensions, or
higher-dimensional spaces
✓ Computer-Aided Design
Circuits and networks for communications, water supply or other utilities are
constructed with repeated placement of a few geographical shapes.
c. Data Visualizations
✓ Producing graphical representations for scientific, engineering and medical data
sets and processes is another fairly new application of computer graphics, which
is generally referred to as scientific visualization. And the term business
visualization is used in connection with data sets related to commerce, industry
and other nonscientific areas.
(b) 10M
Display-Window Management Using GLUT
picture.
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.
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
where the single argument for this function can be any character string that we want
to
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);
After execution of the following statement, all display windows that we have
created, including their graphic content, are now activated:
2 (b) 10 M
✓ In windows to include OpenGL core libraries and GLU we can use the following
header files:-
#include <windows.h> //precedes other header files for including Microsoft windows ver
of OpenGL libraries
✓ In Apple OS X systems, the header file inclusion statement will be, ✓ #include
<GLUT/glut.h>
picture.
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.
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
where the single argument for this function can be any character string that we want
to
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);
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.
Although the display window that we created will be in some default location and
size,
Translation:
3. b
Rotation:
Scaling:
5.a.
5. b USING POINTING DEVICES
• Pointing devices like mouse, trackball, data tablet allow programmer to indicate a position
on the display.
• There are two types of event associated with pointing device, which is conventionally
assumed to be mouse but could be trackball or data tablet also.
• MOVE EVENT – is generated when the mouse is move with one of the button
being pressed. If the mouse is moved without a button being pressed, this event is
called as “passive move event”.
• MOUSE EVENT – is generated when one of the mouse buttons is either pressed or
released.
• The information returned to the application program includes button that
generated the event, state of the button after event (up or down), position
(x,y) of the cursor. Programming a mouse event involves two steps:
6.a
Design of Animation Sequences
Animation sequence in general is designed in the following steps.
1. Storyboard layout
2. Object definitions.
3. Key-frame specifications
4. Generation of in-between frames.
➔ Pixel positions along a line path are then determined by sampling at unit x intervals.
Starting from the left endpoint (x0, y0) of a given line, we step to each successive
column (x position) and plot the pixel whose scan-line y value is closest to the line
path.
CI CCI HOD