Professional Documents
Culture Documents
CG_Oral
CG_Oral
CG_Oral
1. What is C.G?
Computer Graphics (C.G) is the field of creating, manipulating, and displaying visual content using
computers.
OpenGL functions, like those in GLUT (OpenGL Utility Toolkit), provide tools for rendering graphics.
RGB refers to the color model used in graphics, representing colors using combinations of red, green,
and blue components. Functions in OpenGL: OpenGL provides a variety of functions for tasks such as
rendering primitives, applying transformations, and setting up the rendering environment. Some
essential functions include:
1. glBegin() and glEnd(): These functions mark the beginning and end of a block of vertex data
to be rendered. For example:
glBegin(GL_TRIANGLES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glEnd();
2. glClear(): Clears buffers to preset values, such as clearing the color buffer to a specified color.
glClear(GL_COLOR_BUFFER_BIT);
3. glViewport(): Sets the viewport, defining the mapping of normalized device coordinates to
window coordinates.
glViewport(0, 0, 800, 600);
4. glMatrixMode() and glLoadIdentity(): Manipulate the transformation matrices. For example,
switching to the modelview matrix mode and loading the identity matrix:
glMatrixMode(GL_MODELVIEW); glLoadIdentity();
Symbolic Constants in OpenGL: OpenGL uses symbolic constants to represent various parameters
and states. For example:
1. GL_TRIANGLES: Specifies that geometric primitives are triangles.
2. GL_COLOR_BUFFER_BIT: Indicates the color buffer for clearing.
3. GL_MODELVIEW: Specifies the modelview matrix mode.
Specific Data Types in OpenGL: OpenGL uses specific data types for representing vertices, colors, and
matrices. For example:
1. GLfloat: Represents floating-point values used for vertex coordinates and colors.
2. GLint: Represents integer values used for specifying dimensions and indices.
3. GLdouble: Represents double-precision floating-point values.
Both DDA (Digital Differential Analyzer) and Bresenham algorithms plot pixels to draw lines.
In DDA, pixels are plotted incrementally along the line's path, while in Bresenham, pixels are
plotted based on error minimization to draw lines efficiently.
DDA algorithm uses floating-point calculations, while Bresenham algorithm uses integer
arithmetic. Bresenham algorithm is faster and more efficient than DDA.
Bresenham's circle drawing algorithm is used to draw circles efficiently. It plots points along
the circumference of a circle by minimizing error at each step, making it faster than some
other algorithms.
A polygon is a closed geometric shape with straight sides. Types include triangles,
quadrilaterals, pentagons, etc., based on the number of sides.
Flood fill fills a bounded area with color until it encounters a boundary. Boundary fill fills an
area until it reaches a boundary with a different color.
Flood fill starts from a seed point and fills adjacent pixels with the same color until a
boundary is reached. Boundary fill starts from a seed point and fills the interior of the
boundary with a specified color.
A viewport is the area of the screen where graphics are displayed. It defines the boundaries
within which graphics are rendered.
11. Explain Cohen Sutherland polygon clipping algo to clip w.r.to viewport
Cohen Sutherland algorithm is used to clip polygons against a rectangular clipping window
defined by a viewport. It categorizes points as inside, outside, or potentially intersecting the
window and clips accordingly.
Polygon clipping removes portions of polygons outside a specified region. 2D clipping deals
with clipping objects in two-dimensional space. Types include Sutherland-Hodgman, Cohen-
Sutherland, etc.
Reflection flips an object across an axis. Reflection about the x-axis flips an object vertically,
while reflection about the y-axis flips it horizontally.
2D scaling is the transformation of an object by changing its size along the x and y axes. It
involves multiplying the coordinates of the object by scaling factors.
16. What is 2D translation
2D transformation involves changing the position, size, and orientation of an object in a two-
dimensional space. It includes translation, rotation, and scaling.
Koch Curve is a fractal curve with infinite length but finite area. It's constructed by repeatedly
dividing a line segment into three equal parts and replacing the middle segment with an
equilateral triangle.
Bezier curve is a smooth curve defined by control points. It has properties like interpolation,
which means it passes through its control points, and approximation, which allows it to
approximate other curves.
Interpolation involves estimating values between known data points. Approximation involves
finding a simpler function that closely matches a complex function.
A curve is a continuous line or path that connects a series of points. Types include Bezier
curves, B-splines, Hermite curves, etc.
Keyframe animation involves defining key poses or frames, and the computer interpolates
between them to create motion. Morphing is a special type of animation where one object
smoothly transforms into another. Motion specifications and methods of controlling
animation involve defining parameters like timing, speed, and easing functions.
23. What is animation and types of animation, principles of animation, and animation techniques