CG - Assignment 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

COMPUTER GRAPHICS

ASSIGNMENT NO. 2
MULTIPLE CHOICE QUESTIONS:
1. Which of the following is used to represent a transformation matrix in 2D?

a. 2x2 matrix b.3x3 matrix


c. 4x4 matrix d. 5x5 matrix

2. Which of the following transformation changes the shape of an object?

a. Translation b. Scaling
c. Rotation d. All of the above

3. Which of the following is NOT a method for performing rotation transformation?

a. Rotation about an arbitrary point b. Rotation about the origin


c. Rotation about a fixed-point d. Rotation about a line

4. Which of the following transformation is used to create a slanted effect?

a. Translation b. Rotation
b. Scaling d. Shearing

5. What is the result of a translation transformation?

a. The size of the object changes b. The shape of the object changes
c. The position of the object changes d. The orientation of the object changes

6. Which of the following is an example of a 4x4 homogeneous transformation matrix?

a. [1 0 0; 0 1 0; 0 0 1] b. [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]
c. [1 0; 0 1; 0 0; 0 0] d. [1 0 0 0; 0 1 0 0; 0 0 1 0]

Page 1 of 2
7. What is the fourth component of a homogeneous coordinate vector?

a. 0 b. 1
c. -1 d. It can be any value

8. In homogeneous coordinates, what is the purpose of the third column of a 3x3 matrix?

a. It contains the translation values b. It contains the rotation values


b. It contains the scaling values d. It is always a zero vector

9.What is the primary advantage of using homogeneous coordinates in computer


graphics?
a. To simplify the math involved in transformations b. To make graphics more realistic

c. To increase the size of the graphics display d. To reduce the time required for rendering

10. In homogeneous coordinates, a point is represented as a

a. Vector b. Matrix
c. Scalar d. None of the above

SHORT ANSWER TYPE QUESTIONS


1. Define Points and Lines
A Point in three-dimensional geometry is defined as a location in 3D space that is
uniquely defined by an ordered triplet (x, y, z) where x, y, & z are the distances of the
point from the X-axis, Y-axis, and Z-axis respectively.
A Line in three-dimensional geometry is defined as a set of points in 3D that extends
infinitely in both directions and is represented by L: (x – x1) / l = (y – y1) / m = (z – z1) /
n; here (x, y, z) are the position coordinates of any variable point lying on the line.

2. Explain Line Drawing Algorithms?


The Line Drawing Algorithm is a graphical algorithm for representing line segments on
discrete graphical media, such as printers and pixel-based media.”

A line drawing algorithm is a method for estimating a line segment on discrete graphical
media such as pixel-based screens and printers in computer graphics. Line sketching on
such media necessitates an approximation.

Page 2 of 2
Lines are rasterised in one colour using basic methods. Spatial anti-aliasing is a
sophisticated approach that allows for a better representation of numerous colour
gradations.

3. Explain the Inside-Outside Tests.


In Computer Graphics, Inside Outside is performed to test whether a given point lies inside of
a closed polygon or not. Mainly, there are two methods to determine a point is
interior/exterior to polygon:
1. Even-Odd / Odd-Even Rule or Odd Parity Rule
2. Winding Number Method

4. Explain Screen Coordinates System.


The screen coordinate system is a two-dimensional Cartesian coordinate system used in
computer graphics to represent the location of pixels on a display device, such as a
computer monitor or mobile phone screen.
The system is based on a rectangular grid, with the origin typically located at the top-left
corner of the screen. The x-axis extends horizontally from left to right, while the y-axis
extends vertically from top to bottom.
In screen coordinates, the size of the screen is defined by its resolution, which is typically
specified in terms of the number of pixels in the horizontal and vertical directions.

5. Explain Windowing & Clapping?

Page 3 of 2
6. Explain Composite Transformation?

A number of transformations or sequence of transformations can be combined into single one


called as composition. The resulting matrix is called as composite matrix. The process of
combining is called as concatenation.

Suppose we want to perform rotation about an arbitrary point, then we can perform it by the
sequence of three transformations
1. Translation
2. Rotation
3. Reverse Translation

The ordering sequence of these numbers of transformations must not be changed.

LONG ANSWER TYPE QUESTIONS


1. Explain the Bresenham’s Line Algorithm

Bresenham Line Drawing Algorithm is one of the popular computer graphics algorithms
used to overcome the drawback of the DDA (Digital Differential Analyzer) algorithm. The
Bresenham line drawing algorithm is rather slower than the DDA algorithm.

The Bresenham implements the Bresenham line drawing algorithm. This algorithm is
efficient because it involves three integer operations: addition, subtraction, and
multiplication. These three operations will be performed rapidly, so lines should be formed
quickly.

The Bresenham line drawing algorithm determines the points of the N-dimensional raster
selected to generate the close approximation to the straight line between the two coordinates
or points. In the Bresenham line drawing algorithm, the integer is only for addition,
subtraction, and multiplication.

The operation in the Bresenham line drawing algorithm is performed quickly so the line can
be generated quickly. Suppose the line equation is y = mx + c. If the slope(m) value is 1,
both the coordinate incremented, but if the slope value is less than 1, then the y coordinate
may or may not be incremented. The Bresenham line drawing algorithm is used where the
slope value is not equal to one.

Page 4 of 2
2. Explain Transformation in brief with their types
The purpose of using computers for drawing is to provide facility to user to view the object
from different angles, enlarging or reducing the scale or shape of object called as
Transformation.

1. Each transformation is a single entity. It can be denoted by a unique name or symbol.


2. It is possible to combine two transformations, after connecting a single transformation is
obtained, e.g., A is a transformation for translation. The B transformation performs
scaling. The combination of two is C=AB. So, C is obtained by concatenation property.
Types of Transformations:
1. Translation
2. Scaling
3. Rotating
4. Reflection
5. Shearing

3. Explain Homogenous Coordinates system

Page 5 of 2

You might also like