Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 7

Computer graphics

1)Explain the following 3D Transformation in detail.


a) Translation b) Scaling c)Rotation d) Sharing e) Reflection

1. Translation:-
It is the movement of an object from one position to another position.
Translation is done using translation vectors. There are three vectors in 3D
instead of two. These vectors are in x, y, and z directions. Translation in the x-
direction is represented using Tx. The translation is y-direction is represented
using Ty. The translation in the z- direction is represented using Tz.
If P is a point having co-ordinates in three directions (x, y, z) is translated,
then after translation its coordinates will be (x1 y1 z1) after translation. Tx Ty
Tz are translation vectors in x, y, and z directions respectively.
x1=x+ Tx          y1=y+Ty          z1=z+ Tz
Three-dimensional transformations are performed by transforming each vertex of the
object. If an object has five corners, then the translation will be accomplished by
translating all five points to new locations. Following figure 1 shows the
translation of point figure 2 shows the translation of the cube.


Matrix for translation


Matrix representation of point translation
Point shown in fig is (x, y, z). It become (x1,y1,z1) after translation. Tx Ty Tz
are translation vector.

——————————————————————-
2)Scaling
You can change the size of an object using scaling transformation. In the scaling
process, you either expand or compress the dimensions of the object. Scaling can be
achieved by multiplying the original coordinates of the object with the scaling
factor to get the desired result. The following figure shows the effect of 3D
scaling −

In 3D scaling operation, three coordinates are used. Let us assume that the
original coordinates areX, Y, Z , scaling factors are (Sx, Sy,S2)respectively, and
the produced coordinates are x’y’z’. This can be mathematically represented as
shown below

[Sx 0 0. 0
S= 0 Sy 0. 0
0 0 Sz 0
0 0 0. 1]

P'= P.S
[x’y’z’1]=[x Y z 1 ]
Same as per s=
=[X.Sx Y.Sy Z.Sz 1]
——————————————————————
3)Rotation
3D rotation is not same as 2D rotation. In 3D rotation, we have to specify the
angle of rotation along with the axis of rotation. We can perform 3D rotation about
X, Y, and Z axes. They are represented in the matrix form as below −
The following figure explains the rotation about various axes −

d) Sharing :-
Shearing transformation is the same as we see in 2D space, but here we have to deal
with the x, y, and z axes whereas in 2D we deal with the only x and y
axes. Shearing is the process of slanting an object in 3D space either in x, y, or
in the z-direction. Shearing changes(or deformed) the shape of the object. AS we
are discussing 3D space so shearing can also be done in any of the three directions
as follows. Given below are the types of shearing transformation. 
• Shearing in X-direction. 
• Shearing in y-direction 
• Shearing in z-direction

Shearing in X-Direction: Here the coordinate of X remains unchanged while the


coordinate of Y and Z is changed. Shearing is done through the Shearing
Transformation matrix, which is represented as follows.

[1. Sy. Sz. 0


0. 1. 0. 0
Sx = 0. 0. 1. 0
0. 0. 0. 1]

Shearing in Y-Direction: Here the coordinate of Y remains unchanged while the


coordinate of X and Z are changed. Shearing is done through the Shearing
Transformation matrix, which is represented as follows. 
[1. 0. 0. 0
Sx 1. Sz. 0
Sy= 0. 0. 1. 0
0. 0. 0. 1]

Shearing in Z-Direction: Here the coordinate of Z remains unchanged while the


coordinate of X and Y are changed. Shearing is done through the Shearing
Transformation matrix, which is represented as follows for the shearing in Z-
direction. 

[1. 0. 0. 0
Sz=0. 1. 0 0
Sx. Sy 1. 0
0. 0. 0. 1]
——————————————————————-
4)Reflection:-
Reflection is a kind of rotation where the angle of rotation is
180 degree.
-The reflected object is always formed on the other side of mirror.
-The size of reflected object is same as the size of original object.
 
Consider a point object O has to be reflected in a 3D plane.
 
Let-
• Initial coordinates of the object O = (Xold, Yold, Zold)
• New coordinates of the reflected object O after reflection
= (Xnew, Ynew,Znew)
In 3 dimensions, there are 3 possible types of reflection-
 

 
• Reflection relative to XY plane
• Reflection relative to YZ plane
• Reflection relative to XZ plane
——————————————————————
2. Define Projection? Explain Perspective and Parallel projection in detail.
Projection is a technique or process which is used to transform a 3D object into a
2D plane." In other words, we can define "projection as a mapping of points P (x,
y, z) on to its image P' (x,' y,'z') in the projection plane or view plane, which
create the display surface.”
Parallel Projection
Parallel Projection use to display picture in its true shape and size. When
projectors are perpendicular to view plane then is called orthographic projection.
The parallel projection is formed by extending parallel lines from each vertex on
the object until they intersect the plane of the screen. The point of intersection
is the projection of vertex.
Parallel projections are used by architects and engineers for creating working
drawing of the object, for complete representations require two or more views of an
object using different planes.

1. Isometric Projection: All projectors make equal angles generally angle


is of 30°.
2. Dimetric: In these two projectors have equal angles. With respect to
two principle axis.
3. Trimetric: The direction of projection makes unequal angle with their
principle axis.
4. Cavalier: All lines perpendicular to the projection plane are projected
with no change in length.
5. Cabinet: All lines perpendicular to the projection plane are projected
to one half of their length. These give a realistic appearance of object
————————————————————
3)Explain various types of Perspective projections
Perspective Projection
In perspective projection, the distance from the center of projection to project
plane is finite and the size of the object varies inversely with distance which
looks more realistic.
The distance and angles are not preserved and parallel lines do not remain
parallel. Instead, they all converge at a single point called center of projection
or projection reference point. There are 3 types of perspective projections which
are shown in the following chart.
• One point perspective projection is simple to draw.
• Two point perspective projection gives better impression of depth.
• Three point perspective projection is most difficult to draw.
• ———————————————————
a) Diffuse Iiiumination:-
An objects illumination is as important as its surface properties in
computing its intensity. The object may be illuminated by light which does not come
from any particular source but which comes from all directions. When such
illumination is uniform from all directions, the illumination is called diffuse
illumination. Basically the diffuse illumination is a background light which is
reflected from walls, floor, and ceiling.
when we assume that going up, down, right and left is of same amount then we can
say that the reflections are constant over each surface of the object and they are
independent of the viewing direction. Such a reflection is called diffuse
reflection. In practice, when object is illuminated, some part of light energy is
absorbed by the surface of the object, while the rest is reflected. The ratio of
the light reflected from the surface to the total incoming light to the surface is
called coefficient of reflection or the reflectivity. It is denoted by R. The value
of R varies from 0 to 1. it is closer to 1 for white surface and closer to 0 for
black surface.
——————————————————————
b) Specular Reflection:-
Specular reflection, also known as veiling reflection, is light reflection
from an object or task that obscures details. It is a vital concept in the field of
lighting.

Specular reflection is a type of surface reflectance often described as a mirror-


like reflection of light from the surface. In specular reflection, the incident
light is reflected into a single outgoing direction.
Light reflects on a surface known as specular surface (similar to that of a mirror)
at the angle of incidence. It is further reflected at a similar angle.
The type of surface on which it is reflected, as well as the position of the light
source, affect the secondary beam. For instance, consider when light falls on an
uneven or irregular surface such as an unpolished or ragged surface. The absorption
effect is higher because it reduces the reflected light beam’s strength. To produce
specular reflection, surface irregularities need to be smaller than the length of
the beam’s radiation, such as in the case of polished metal, glass, plastic or
transparent liquid surfaces. On a “perfect” surface, the angle of beam radiation is
equivalent to that of the incident radiation.
Specular reflection rarely occurs in nature, but rather in man-made spaces. Still
waters are an example of nature’s ability to produce this type of reflection.
——————————————————————-
3-D Transformation :3-D Transformation is the process of manipulating the view
of a three-D object with respect to its original position by modifying its physical
attributes through various methods of transformation like Translation, Scaling,
Rotation, Shear, etc.
Properties of 3-D Transformation :
• Lines are preserved,
• Parallelism is preserved,
• Proportional distances are preserved.
• ——————————————————
d) B-spline curve
Concept of B-spline curve came to resolve the disadvantages having by Bezier
curve, as we all know that both curves are parametric in nature. In Bezier curve we
face a problem, when we change any of the control point respective location the
whole curve shape gets change. But here in B-spline curve, the only a specific
segment of the curve-shape gets changes or affected by the changing of the
corresponding location of the control points.
In the B-spline curve, the control points impart local control over the curve-shape
rather than the global control like Bezier-curve
—————————————————————-
e) HSV colour Model:-

The HSV color wheel sometimes appears as a cone or cylinder, but always with these
three components:

Hue
Hue is the color portion of the model, expressed as a number from 0 to 360 degrees:

• Red falls between 0 and 60 degrees.


• Yellow falls between 61 and 120 degrees.
• Green falls between 121 and 180 degrees.
• Cyan falls between 181 and 240 degrees.
• Blue falls between 241 and 300 degrees.
• Magenta falls between 301 and 360 degrees.

Saturation
Saturation describes the amount of gray in a particular color, from 0 to 100
percent. Reducing this component toward zero introduces more gray and produces a
faded effect. Sometimes, saturation appears as a range from 0 to 1, where 0 is
gray, and 1 is a primary color.

Value (or Brightness)


Value works in conjunction with saturation and describes the brightness or
intensity of the color, from 0 to 100 percent, where 0 is completely black, and 100
is the brightest and reveals the most color
—————————————————————-
Orthographic projection:-
(sometimes referred to as orthogonal projection, used to be called analemma is a
means of representing three-dimensional objects in two dimensions. It is a form of
parallel projection, in which all the projection lines are orthogonal to the
projection plane, resulting in every plane of the scene appearing in affine
transformation on the viewing surface. The obverse of an orthographic projection is
an oblique projection, which is a parallel projection in which the projection lines
are not orthogonal to the projection plane.
————————————-_______________—
#Primary Color system:-
The RGB color model is one of the most widely used
color representation method in computer graphics. It use a color coordinate system
with three primary colors:
R(red), G(green), B(blue)
Each primary color can take an intensity value ranging from 0(lowest) to
1(highest). Mixing these three primary colors at different intensity levels
produces a variety of colors. The collection of all the colors obtained by such a
linear combination of red, green and blue forms the cube shaped RGB color space.
—————————————————————
5.Difference between Parametric and Non-Parametric Methods are as follows:
Parametric Methods Non-Parametric Methods
Parametric Methods uses a fixed number of parameters to build the model. Non-
Parametric Methods use the flexible number of parameters to build the model.
Parametric analysis is to test group means. A non-parametric analysis is to
test medians.
It is applicable only for variables. It is applicable for both – Variable and
Attribute.
It always considers strong assumptions about data. It generally fewer
assumptions about data.
Parametric Methods require lesser data than Non-Parametric Methods. Non-
Parametric Methods requires much more data than Parametric Methods.
Parametric methods assumed to be a normal distribution. There is no assumed
distribution in non-parametric methods.
Parametric data handles – Intervals data or ratio data. But non-parametric
methods handle original data.
Here when we use parametric methods then the result or outputs generated can be
easily affected by outliers. When we use non-parametric methods then the result or
outputs generated cannot be seriously affected by outliers.
Parametric Methods can perform well in many situations but its performance is at
peak (top) when the spread of each group is different. Similarly, Non-
Parametric Methods can perform well in many situations but its performance is at
peak (top) when the spread of each group is the same.
Parametric methods have more statistical power than Non-Parametric methods. Non-
parametric methods have less statistical power than Parametric methods.
As far as the computation is considered these methods are computationally faster
than the Non-Parametric methods. As far as the computation is considered these
methods are computationally slower than the Parametric methods.
Examples: Logistic Regression, Naïve Bayes Model, etc. Examples: KNN, Decision
Tree Model, etc
——————————————————————-
6 .Explain Spline representation of curve:-

A spline curve is a mathematical representation for which it is easy to build an


interface that will allow a user to design and control the shape of complex curves
and surfaces. The general approach is that the user enters a sequence of points,
and a curve is constructed whose shape closely follows this sequence. The points
are called control points. A curve that actually passes through each control point
is called an interpolating curve; a curve that passes near to the control points
but not necessarily through them is called an approximating curve
———————————————————————
8. Explain Bezier curve in detail
Bezier Curve may be defined as-
• Bezier Curve is parametric curve defined by a set of control points.
• Two points are ends of the curve.
• Other points determine the shape of the curve.
 Bezier Curve Example-
The following curve is an example of a bezier curve-

 

 
Here,
This bezier curve is defined by a set of control points b0, b1, b2 and b3.
• Points b0 and b3 are ends of the curve.
• Points b1 and b2 determine the shape of the curve.
• ————————————————————
9. Define Fractals and explain classification of fractals.
Fractals can also be classified according to their self-similarity. There are
three types of self-
similarity found in fractals:
Exact self-similarity - This is the strongest type of self-similarity; the fractal
appears
identical at different scales. Fractals defined by iterated function systems often
display
exact self-similarity. For example, the Sierpinski triangle and Koch snowflake
exhibit
exact self-similarity.
Quasi-self-similarity - This is a looser form of self-similarity; the fractal
appears
approximately (but not exactly) identical at different scales. Quasi-self-similar
fractals
contain small copies of the entire fractal in distorted and degenerate forms.
Fractals
defined by recurrence relations are usually quasi-self-similar. The Mandelbrot set
is
quasi-self-similar, as the satellites are approximations of the entire set, but not
exact
copies.
Statistical self-similarity - This is the weakest type of self-similarity; the
fractal has
numerical or statistical measures which are preserved across scales. Most
reasonable
definitions of "fractal" trivially imply some form of statistical self-similarity.
(Fractal
dimension itself is a numerical measure which is preserved across scales.) Random
fractals are examples of fractals which are statistically self-similar. The
coastline of
Britain is another example; one cannot expect to find microscopic Britains (even
distorted ones) by looking at a small section of the coast with a magnifying glass.
———————————————————————
15. Discuss the Properties of light.
Following are the properties of light:
• Reflection of light: Every light follows the law of reflection which
states that the angle of incidence is equal to the angle of reflection.
• Refraction of light: Refraction of light takes place when the light ray
changes its velocity it passes from one medium to another. Index of refraction is
used as a means to measure how much light refracts.
• Dispersion: Dispersion of light is defined as the process in which the
white light separates into different colours based on its wavelength when passed
through a glass prism.
•  Diffraction: The effect of bending light around small obstacle corners
and hence its encroachment into the geometric shadow region is called diffraction.
• Polarization of light: Normal light vibrates in all directions
perpendicular to the propagation of light. If the light is constrained to vibrate
in only one particular plane, then the light is called polarized light.
• Interference of light: Interference is the phenomenon of modification
in the intensity of light due to the redistribution of light energy in the region
of superposition of two or more light waves.————————————————————
11. Explain Hilbert’s curves and Koch curve.
The Hilbert curve (also known as the Hilbert space-filling curve) is a
continuous fractal space-filling curve first described by the German mathematician
David Hilbert in 1891,[1] as a variant of the space-filling Peano curves discovered
by Giuseppe Peano in 1890.

Because it is space-filling, its Hausdorff dimension is 2 (precisely, its image is


the unit square, whose dimension is 2 in any definition of dimension; its graph is
a compact set homeomorphic to the closed unit interval, with Hausdorff dimension
2).
The Hilbert curve is constructed as a limit o
curve is contained in a square with area

Koch curve:-
The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a
mathematical curve and one of the earliest fractal curves to have been described.
It is based on the Koch curve, which appeared in a 1904 paper titled “On a
continuous curve without tangents, constructible from elementary geometry” by the
Swedish mathematician Helge von Koch.
—————-___________—————————-
14. Explain Lambert’s cosine Law:-
Lambert's cosine law says that the amount of light energy arriving at a surface
is proportional to the cosine of the angle between the light direction and the
surface normal . This law is typically used in radiometry and computer graphics,
and this notebook is to help build a geometric intuition behind the rule.

You might also like