CS602-Computer
Graphics
(SUBJECTIVE)
CURRENT
[email protected] FOR MORE VISIT JUNAID MALIK
[email protected]
VULMSHELP.COME 0304-1659294
AL-JUNAID TECH INSTITUTE
1. Difference between point and vector?
ANSWER:
Point Vector
A point position in space. A Vector no fixed position in space
The only characteristic that A Vector has both magnitude and
distinguishes one point from another is direction.
its position.
we draw points as dots vectors as line segments with arrows.
2. Grouard shading:
ANSWWER:
is a per-vertex color computation. What this means is that the vertex shader must
determine a color for each vertex and pass the color as an out variable to the
fragment shader. Since this color is passed to the fragment shader as an in varying
variable.
3. Phung shading:
ANSWER:
is a per-fragment color computation. The vertex shader provides the normal and
position data as out variables to the fragment shader. The fragment shader then
interpolates these variables and computes the color.
4. Fractals and Euclidean geometry:
ANSWER:
Fractals are distinct from the simple figures of classical,
Euclidean, geometry—the square, the circle, the sphere, and so forth.
They are capable of describing many irregularly shaped objects or spatially
nonuniform phenomena in nature such as coastlines and mountain ranges.
5. Types of fractals:
ANSWER:
AL-JUNAID TECH INSTITUTE
Fractal Trees
Fractals in Animal Bodies.
Fractal Snowflakes.
Fractal Lightning and Electricity.
Fractals in Plants and Leaves.
Two basic types of projections are provided for us by
OpenGL, along with several corresponding commands for describing the relevant
parameters in different ways. One type is the perspective projection.
6. OpenGL:
ANSWER
The OpenGL API is a portable API that can be compiled and run on many
platforms. OpenGL programs are typically written in C and C++.
7. What is GLUT?
ANSWER:
GLUT (pronounced like the glut in gluttony) is the OpenGL Utility Toolkit, a
window system independent toolkit for writing OpenGL programs.
8. Curves
ANSWER:
are regular bends provided in the lines of communication like roads,
railways etc. and also in canals to bring about the gradual change of
direction. They are also used in the vertical plane at all changes of grade to
avoid the abrupt change of grade at the apex.
9. Advantages of curve:
ANSWER:
They provide comfort to the passengers. If there is an abrupt change in the
direction nor grade of a highway it will upset the passengers.
10.Define Bezier curve and its formula?
AL-JUNAID TECH INSTITUTE
ANSWER:
A Bezier curve generally follows the shape of the defining polygon.
Formula:
P(u) = Σ (n choose i) * (1 - u)^(n-i) * u^i * Pi
11.Why 24-bit RGB is called true color, define how red green and blue
values in it?
ANSWER:
A 24-bit display, of course, uses 24 bits, or 3 bytes per pixel,
for color information. This gives 1 byte, or 256 distinct values each, for red, green,
and blue. This is generally called true color, because 2563 (16.7 million) colors is
about as much as your eyes can discern, so more color resolution really isn't
necessary, at least for computer monitors.
12.Advantages of plasma display
ANSWER:
Can be wall mounted.
Less bulky than rear projection television.
Virtually less motion blur, so better motion tracking like high refresh rates and
faster response time.
Far wider viewing angle.
More pixels per inch.
13.Disadvantages of plasma display.
ANSWER:
Commonly do not come in smaller sizes than 40 inches.
Heavier in weight with respect to screen size.
A picture is not so clear under bright conditions.
Glass screen damage can be permanent and far more difficult to repair.
Poor reproduction of black.
Radiation is emitted for screen.
14.Write the name of Texture Mapping?
AL-JUNAID TECH INSTITUTE
ANSWER:
1. Perfect Mapping:
2. Affine Mapping
3. Area Subdivision
4. Scan-line Subdivision
5. Parabolic Mapping
6. Hyperbolic Mapping
7. Constant-Z Mapping
15. Write Implicit equation of plane?
ANSWER:
. The implicit equation for a plane is:
ax+by+cz+d=0
16. write the types of lighting?
There are three basic types of lighting you should layer in a room in order to
accomplish this:
Ambient
general lighting.
Accent lighting.
Task lighting.
17. Write Specular Reflection with effects?
ANSWER:
Specular reflection from an object produces highlights. Unlike ambient and
diffuse reflection, the amount of specular reflection seen by a viewer does
depend on the location of the viewpoint - it's brightest along the direct angle of
reflection. To see this, imagine looking at a metallic ball outdoors in the
sunlight.
18. Effects of OpenGL
ANSWER:
OpenGL allows us to set the effect:
GL_SPECULAR)
GL_SHININESS).
18. Explain Hermite curve?
AL-JUNAID TECH INSTITUTE
A Hermite curve is a spline where every piece is a third degree polynomial defined
in Hermite form: that is, by its values and initial derivatives at the end points of the
equivalent domain interval.
drawbacks: – Enumerating points on the curve is hard
The hidden surface removal is the procedure used to find which surfaces are not
visible from a certain view. A hidden surface removal algorithm is a solution to the
visibility issue, which was one of the first key issues in the field of three-
dimensional graphics.
19.Explain its important in 3D:
ANSWER:
In 3D computer graphics, hidden surface determination (also known as hidden
surface removal (HSR), occlusion culling (OC) or visible surface determination
(VSD)) is the process used to determine which surfaces and parts of surfaces are
not visible from a certain viewpoint.
20. Explain Modeling Transformations?
ANSWER:
The three OpenGL routines for modeling transformations are glTranslate*(),
glRotate*(), and glScale*().All three commands are equivalent to producing an
appropriate translation, rotation, or scaling matrix, and then calling
glMultMatrix*() with that matrix as the argument. Translate
void glTranslate{fd}(TYPEx, TYPE y, TYPEz);
21. Briefly explain Oren—Nayar Diffuse Reflection?
ANSWER:
Though there's been a lot of research on specular reflection models, there's been
less research on diffuse reflection models. One of the problems of the standard
Lambertian model is that it considers the surface as a smooth diffuse surface.
Surfaces that are really rough, like sandpaper, exhibit much more of a
backscattering effect, particularly when the light source and the view direction
are in the same direction.
22. Two properties of triangle of lambert?
ANSWER:
AL-JUNAID TECH INSTITUTE
Lambert:
Triangles that use Lambertian shading are painted with one solid color instead of
using a gradient. Typically, each triangle is lit using that triangle's normal. The
resulting object looks very angular and sharp.
23.Advantages of IMPLICIT
ANSWER:
Better retention over time with less skill loss than explicit.
More resistance to the effects of psychological stress, disorders and
dysfunction.
Independence of age and IQ.
Implicit, small individual differences, explicit, large individual differences.
24. Advantages of EXPLICIT
ANSWER:
Explicit instruction breaks up learning into smaller parts.
This lightens the “cognitive load,” or how much brain resources a student
needs to process information. A lighter cognitive load frees up working
memory.
That's important because learning new skills requires a lot of working
memory
25. Advantages of PARAMETER.
ANSWER:
Parameters and return values allow students to write programs that are more
organized and cleaner.
Naming functions helps students write programs that read more like
descriptions of what they do, and they also help students reuse code
26. Write down the simplified third-degree equation of Bezier Curve?
ANSWER:
The simplified third-degree equation of a Bezier Curve with control
points P0, P1, P2, and P3 is:
B(t) = (1-t)3P0 + 3t(1-t)2P1 + 3t2(1-t)P2 + t3P3,
AL-JUNAID TECH INSTITUTE
where t is the parameter that varies from 0 to 1, and B(t) is the
resulting point on the curve.
27. Briefly define two basic methods of projection?
ANSWER:
two basic methods of projection are following
Parallel Projection:
Parallel projection methods are used by drafters and engineers to
create working drawings of an object which preserves its scale and
shape. The complete representation of these details often requires
two or more views (projections) of the object onto different view
planes.
Perspective Projection:
Perspective projection is a type of drawing that graphically
approximates on a planar (two-dimensional) surface (e.g. paper) the
images of three-dimensional objects so as to approximate actual
visual perception
28. Identify two properties of triangles that are used in Lambertian
shading.
ANSWER:
Lambertian shading is a simple lighting model that assumes
that the light is reflected equally in all directions from a surface,
which means that the brightness of the surface is proportional to the
cosine of the angle between the surface normal and the light
direction.
Two properties of triangles that are used in Lambertian shading are:
Normal vector:
Area
29. Write down the formula for light equation.
ANSWER:
FinalColor = Ambient + Diffuse + Specular
30. What will be the effect of using (0,0,0) as the argument for
giTranslate*O?
ANSWER:
AL-JUNAID TECH INSTITUTE
The giTranslateO operation refers to the translation of an object by
a given offset vector O. If the argument (0,0,0) is used as the offset
vector O, the effect would be that the object would not be
translated at all. This is because the translation operation moves the
object in the direction of the offset vector, and a zero vector has no
direction or magnitude, so the object would remain in its original
position. Therefore, using (0,0,0) as the argument for giTranslateO
would have no effect on the object's position or appearance.
31. Give parametric equation of a plane curve.
ANSWER:
The parametric equation of a plane curve is a set of equations that
describe the position of a point (x, y) on the curve as a function of
one or more parameters, usually denoted by t. The general form of
a parametric equation for a plane curve is:
x = f(t)
y = g(t)
where f and g are functions that define the position of the point (x, y)
on the curve as a function of the parameter t. The specific form of f
and g depends on the shape of the curve.
For example, the parametric equation of a circle centered at (a, b) with
radius r can be expressed as:
x = a + rcos(t)
y = b + rsin(t)
where t is the parameter that varies from 0 to 2*pi, and (x, y) gives
the position of a point on the circle corresponding to the parameter
t. Other examples of plane curves with parametric equations
include lines, ellipses, parabolas, and hyperbolas.
32. Briefly explain the following:
1. Textured Triangles
2. Flat Triangles
Explain with the reason which one of the above triangles is
more difficult to render?
ANSWER:
AL-JUNAID TECH INSTITUTE
Textured Triangles:
Textured triangles are triangles that have a texture map applied to
them. A texture map is an image that is used to define the
appearance of the surface of an object, and is mapped onto the
triangle to give the appearance of a surface texture. Textured
triangles are commonly used in computer graphics to give objects a
more realistic appearance.
Flat Triangles:
Flat triangles are triangles that have a single color applied to them,
and do not have any surface texture or shading. Flat triangles are
the simplest type of triangle to render, as they require only a single
color value for each pixel in the triangle.
Of the two types of triangles, textured triangles are generally more
difficult to render. This is because rendering a textured triangle
requires not only computing the color of each pixel in the triangle,
but also mapping the texture coordinates onto the triangle to
determine the texture value for each pixel. This can be a complex
process, especially for large or complex textures, and can require
significant computational resources. In contrast, flat triangles are
simpler to render because they require only a single color value for
each pixel, which can be computed directly from the color of the
triangle's vertices using simple interpolation techniques.
33. Explain, what is "hue" and "saturation"?
ANSWER:
In color theory and image processing, "hue" and "saturation" are
two important properties that describe the characteristics of a color.
Hue refers to the actual color of a particular wavelength of light, or
the position of a color on the color spectrum. Hue is commonly
measured in degrees around a color wheel, with red, yellow, green,
cyan, blue, and magenta arranged in a circle. Hue is what
distinguishes one color from another, and is the property that most
people associate with the term "color."
Saturation, on the other hand, refers to the intensity or purity of a
AL-JUNAID TECH INSTITUTE
color. A highly saturated color is one that has a strong, pure color
with no gray or white mixed in, while a desaturated color has less
intensity and may appear more muted or grayish. Saturation is
often measured as a percentage, with 0% saturation representing
gray or black, and 100% saturation representing a fully saturated
color.
34. P(1) = (242 - 3u + 1) Po + (-412 + 4u) Po.5 + (242 - w) Pi
The above stated equation is expressed in Geometric Form,
write this equation compactly with matrices?
ANSWER:
P(1) = [ (242 - 3u + 1), (-412 + 4u), (242 - w) ] [ Po, Po.5, Pi ]^T
In this equation, the vector [ Po, Po.5, Pi ] represents the control
points of the Bezier curve, and the coefficients [ (242 - 3u + 1), (-
412 + 4u), (242 - w) ] determine the shape of the curve. This
compact form allows the Bezier curve to be evaluated using matrix
multiplication, which can be more efficient than computing each
component of the curve separately.
35. Write code for the pushing and popping a matrix by using the
designing car example studied in your course.
ANSWER:
// Initialize the modelview matrix as the identity matrix
GLfloat modelview[16];
glLoadIdentity();
// Apply translation to move the car to the desired position
glTranslatef(x, y, z);
// Push the current modelview matrix onto the stack
glPushMatrix();
// Apply rotation to orient the car in the desired direction
glRotatef(angle, 0.0f, 1.0f, 0.0f);
// Draw the car body
AL-JUNAID TECH INSTITUTE
glPushMatrix();
glScalef(length, height, width);
drawCarBody();
glPopMatrix();
// Draw the wheels
glPushMatrix();
glTranslatef(-length/2, -height/2, width/2);
drawWheel();
glPopMatrix();
glPushMatrix();
glTranslatef(length/2, -height/2, width/2);
drawWheel();
glPopMatrix();
glPushMatrix();
glTranslatef(-length/2, -height/2, -width/2);
drawWheel();
glPopMatrix();
glPushMatrix();
glTranslatef(length/2, -height/2, -width/2);
drawWheel();
glPopMatrix();
// Pop the modelview matrix from the stack
glPopMatrix();