SAPTHAGIRI COLLEGE OF ENGINEERING
(Affiliated to Visvesvaraya Technological University, Belagavi & Approved by AICTE, New Delhi.)
#14/5, Chikkasandra, Hesaraghatta Main Road, Bengaluru 560 057.
Web: www sapthagiri edu.in, Email: hodese@sapthagiri.edu.in
Phone: 080-28 372800/1/2-228 Fax: 080-28 372797
Creating Tomorrow Department of Computer Science & Engineering
Academic Year: Even /2019- 2020
‘SUB: Computer Graphics and Mini Project Lab [ SUB-CODE : 17CSL68 | Sem & Section :VI
STAFF-INCHARGE : Prof. Kamalakshi Naganna
1, What is Computer Graphics?
Answer: Computer graphics are graphics created using computers and, more generally, the representation and
manipulation of image data by a computer.
2. Whatis OpenGL?
‘Answer: OpenGL is the most extensively documented 3D graphics API (Application Program Interface) to date. It is
used to create Graphics.
3. Whatis GLUT?
‘Answer: The OpenGLUtility Toolkit (GLUT) is a library of utilities for OpenGL programs, which primarily perform
system-level I/O with the host operating system,
4. Explain in breif 3D Sierpinski gasket?
‘Answer: The Sierpinski triangle (also with the original orthography Sierpitiski), also called the Sierpinski gasket or the
Sierpinski Sieve, is a fractal named after the Polish mathematician WaclawSierpitiski who deseribed it in 1915.
Originally constructed as a curve, this is one of the basic examples of self-similar sets, ic. it is a mathematically
generated pattern that can be reproducible at any magnification or reduction,
S. What is Liang-Barsky line elipping algorithm?
‘Answer: In computer graphics, the Liang-Barsky algorithm is a line clipping algorithm. The Liang-Barsky algorithm
uses the parametric equation of a line and: inequalities describing the range of the clipping box to determine the
intersections between the line and the clipping box. With these intersections it knows which portion of the line should
be drawn,
6. Explain in brief Cohen-Sutherland line-clipping algorithm?
Answer; The Cohen-Suthérland line clipping algorithm quickly detects and dispenses with two common and trivial
cases. To clip a line; we need to, consider only its endpoints. If both endpoints of a line lie inside the window, the entire
lies inside the window? It is trivially accepted and needs no clipping. On the other hand, if both endpoints of a line
cemtiely to one'side Of the Window, the line must lie entirely outside of the window. It is trivially rejected and needs
to beneither clipped tor displayed.
7. Explain in brief scan-line area filling algorithm?
Answer: The scanline fill algorithm is an ingenious way of filling in irregular polygons, The algorithm begins with a
set of points. Each point is connected to the next, and the line between them is considered to be an edge of the polygon.
‘The points of each edge are adjusted to ensure that the point with the smaller y value appears first. Next, a data
structure is created that contains a list of edges that begin on each scanline of the image. The program progresses from
the first scanline upward. For each line, any pixels that contain an intersection between this scanline and an edge of the
polygon are filled in. Then, the algorithm progresses along the scanline, turning on when it reaches @ polygon pixel and
turning off when it reaches another one, all the way aeross the scanline,SAPTHAGIRI COLLEGE OF ENGINEERING
(Affiliated to Visvesvaraya Technological University, Belagavi & Approved by AICTE, New Delhi.)
#14/5, Chikkasandra, Hesaraghatta Main Road, Bengaluru- 560 057,
‘Web: www.sapthagiri edu in, Email: hodese@sapthagiri.edu.in
Phone: 080-28 372800/1/2-228 Fax: 080-28 372797
Department of Computer Science & Engineering
Academic Year: Even /2019- 2020
8, Explain Midpoint Line algorithm
Answer: The Midpoint line algorithm is an algorithm which determines which points in an n-dimensional raster
should be plotted in order to form a close approximation to a straight line between two given points. It is commonly
used to draw lines on a computer screen, as it uses only integer addition, subtraction and bit shifting, all of which are
very cheap operations in standard computer architectures.
& What is a Pixel?
Answer: In digital imaging, a pixel (or picture element) is a single point in a raster image, The Pixel is the smallest
addressable screen element; it is the smallest unit of picture which can be controlled. Each Pixel has its address. The
address of Pixels corresponds to its coordinate. Pixels are normally arranged in a 2-dimensional grid, and are often
represented using dots or squares,
10. What is Graphical User Interface?
Answer: A graphical user interface (GUI) is a type of user interface item that allows people to interact with programs
in more ways than typing such as computers; hand-held devices such as MP3 Players, Portable Media Players or
‘Gaming devices; household appliances and office equipment with images rather than text commands.
11, Whatis the general form of an OpenGL program?:
Answer: There are no hard and fast rules. The following pseudSeodis generally recognized as good OpenGL. form.
program_entrypoint
{
1/ Determine which depth or pixel format should be used,
1/ Create a window with the desired format
1/ Create a tendering context and make it current with the window
1/ Set up initial OpenGL. state.
(/ Set up callback routines for window resize and window refresh.
)
hhandle_resize
{
alViewport(.)s
g/MatrixMode(GL_PROJECTION);
glLoadidentity();
1/ Set projection transform with glOrtho, giFrustum, gluOrtho2D, gluPerspective, ete.
5
handle refresh
{
2lClear(..}:
glMatrixMode(GL_MODELVIEW);
glLoadldentity();
1 Set view transform with gluLookAt or equivalent
11 For each object (i) in the scene that needs to be rendered:
// Push relevant stacks, ¢ g., gIPushMatrix, glPushAttrib,
4) Set OpenGL state specific to object (i)
1/ Set model transform for object (i) using gl Translatef, glScalef, glRotatef, and/or equivalent.SAPTHAGIRI COLLEGE OF ENGINEERING
(Affiiated to Visvesvaraya Technological University, Belagavi & Approved by AICTE, New Delhi.)
#14/5, Chikkasandra, Hesaraghatta Main Road, Bengaluru 560 057.
Web: www sapthagiti.edu.in, Email: hodese@sapthagiri edu. in
Sal PTHAGIRI Phone: 080-28 372800/1/2-228 Fax: 080-28 372797
Creating Tomeriow Department of Computer Science & Engineering
Academic Year: Even /2019- 2020
issue rendering commands for object
1/ Pop relevant stacks, (¢.g., gIPopMatrix, gIPopAttrib.)
i! End for loop.
Swap buters,
}
12. What support for OpenGL does {Open,Net,Free}BSD or Linux provide?
Answer: The X Windows implementation, XFree86 4.0, includes support for OpenGL using Mesa or the OpenGL.
Sample Implementation. XFree86 is released under the XFree86 license. htip://\www.xfree86.org/
13, Whatis the AUX library?
Answer: The AUX library was developed by SGI early in OpenGL’s life 10 ease ereation of small OpenGL.
demonstration programs. It's currently neither supported nor maintained. Developing OpenGL programs using AUX is
strongly discouraged. Use the GLUT instead, I's more flexible and powerful and is-available on a wide range of
platforms. Very important: Don't use AUX. Use GLUT instead.
14, How does the camera work in OpenGL?
Answer: As far as OpenGL is concerned, there is no camera.
More specifically, the camera is always located at the eye’space coordinate (01, 0:s-0.). To give the appearance of
moving the camera, your OpenGL application must move the scene With the inverse of the camera transformation.
15. How do I implement a zoom operation?
Answer: A simple method for zooming is to use a'uniform scale on the ModelView matrix. However, this often results
in clipping by the zNear and 2Far clipping planes if the model is scaled too large. A better method is to restrict the
‘width and height of the view volume in the Projection matrix.
16, What are OpenGL coordinate units?
Answer: Depending on the contents of your geometry database, it may be convenient for your application to treat one
OpenGL coordinate unit as being equal to one millimeter or one parsec or anything in between (or larger or smaller),
OpenGL also lets you specify, your geometry’ with coordinates of differing values. For example, you may find it
convenient to model an airplane's controls in centimeters, its fuselage in meters, and a world to fly around in
Kilometers. OpenGL's ModelView matrix can then scale these different coordinate systems into the same eye
coordinate space,
Its the application's responsibility to ensure that the Projection and ModelView matrices are constructed to provide an
age that keeps the viewer at an appropriate distance, with an appropriate field of view, and keeps the zNear and 2Far
clipping planes at/an appropriate range. An application that displays molecules in micron scale, for example, would
Probably not want to plice the viewer at a distance of 10 feet with a 60 degree field of view.
17, What is Microsoft Visual Studio?
Answer: Microsoft Visual Studio is an integrated development environment (IDE) for developing windows
applications. It is the most popular IDE for developing windows applications or windows based software,
18, What does the .gl or GL file format have to do with OpenGL?
Answer: .gl files have nothing to do with OpenGL, but are sometimes confused with it.I isa file format for images,
which has no relationship to OpenGL.SAPTHAGIRI COLLEGE OF ENGINEERING
(Affiliated to Visvesvaraya Technological University, Belagavi & Approved by AICTE, New Delhi.)
#14/5, Chikkasandra, Hesaraghatta Main Road, Bengaluru- 560 057.
Web: www,sapthagiri.edu.in, Email: hodese@sapthagiri.edu.in
SAPTHAGIRI Phone: 080-28 372800/1/2-228 Fax: 080-28 372797
Creating Tomertow Department of Computer Science & Engineering
Academic Year: Even /2019- 2020
issue tendering commands for object
1/ Pop relevant stacks, (c.g., g!PopMatrix, giPopAttib.)
i! End for loop.
1 Swap buffers,
}
12, What support for OpenGL does {Open,Net,Free}BSD or Linux provide?
Answer: The X Windows implementation, XFree86 4.0, includes support for OpenGL using Mesa or the OpenGL
Sample Implementation. XFree86 is released under the XFree86 license. http://www. xfree86.org/
13, Whatis the AUX library?
‘Answer: The AUX library was developed by SGI early in OpenGL’s life 10 ease ereation of small OpenGL.
demonstration programs. It's currently neither supported nor maintained. Developing OpenGL programs using AUX is
strongly discouraged. Use the GLUT instead, I's more flexible and powerful and is-available on a wide range of
platforms. Very important: Don't use AUX. Use GLUT instead.
14, How does the camera work in OpenGL?
Answer: As far as OpenGL is concerned, there is no camera.
More specifically, the camera is always located at the eye: space coordinate (0 0.s-0.). To give the appearance of
moving the camera, your OpenGL application must move the scene With the inverse of the camera transformation,
15. How do I implement a zoom operation?
Answer: A simple method for zooming is to use a uniform scale on the ModelView matrix. However, this often results
in clipping by the zNear and zFar clipping planes if the model is scaled too large. A better method is to restrict the
‘width and height of the view volume in the Projection matrix.
16, What are OpenGL coordinate units?
Answer: Depending on the contents of your geometry database, it may be convenient for your application to treat one
OpenGL coordinate unit as being equal to one millimeter or one parsec or anything in between (or larger or smaller),
OpenGL also lets you specify, your geometry with coordinates of differing values. For example, you may find it
convenient to model an airplane's controls in centimeters, its fuselage in meters, and a world to fly around in
Kilometers. OpenGL's ModelView matrix can then scale these different coordinate systems into the same eye
coordinate space,
Its the application's responsibility to ensure that the Projection and ModelView matrices are constructed to provide an
age that keeps the Viewer at an appropriate distance, with an appropriate field of view, and keeps the zNear and 2Far