0% found this document useful (0 votes)
15 views8 pages

Paper-1 CG

Uploaded by

Shivangi Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views8 pages

Paper-1 CG

Uploaded by

Shivangi Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Paper-1(CG)

PART A
Q1(A): Bresenham’s Line Drawing Algorithm

Given: Start point P( -3, 0 ) , End point Q( 4, 4 ) .

Step 1: Calculate Δx and Δy


• Δx = x_2 - x_1 = 4 - (-3) = 7

• Δy = y_2 - y_1 = 4 - 0 = 4

Step 2: Initial Decision Parameter

The initial decision parameter is:


P_0 = 2Δy - Δx = 2(4) - 7 = 8 - 7 = 1

Step 3: Plot the Points

The algorithm uses decision parameters P_k to determine the next


point:
• If P_k < 0 , move East (E): x=x+1, y=y

• If P_k \geq 0 , move North-East (NE): x=x+1, y=y+1

The table below shows the step-by-step calculation:


Step Pk (X, Y) Action Updated Pk
1 1 (-3, 0) Move NE P_1 = -5
2 -5 (-2, 1) Move E P_2 = -1
3 -1 (-1, 1) Move NE P_3 = 3
4 3 (0, 2) Move NE P_4 = -3
5 -3 (1, 2) Move E P_5 = 1
6 1 (2, 3) Move NE P_6 = -5
7 -5 (3, 3) Move E P_7 = -1
8 -1 (4, 4) Move NE End Reached

Result: The line connects (-3,0) to (4,4) efficiently using integer


calculations.

Q1(B): Bresenham’s Circle Drawing Algorithm

Given: Radius r = 10 , Center = (0, 0) .


Step 1: Start Point and Decision Parameter
• Start point: (x, y) = (0, 10)

• Initial decision parameter:


P_0 = 3 - 2r = 3 - 2(10) = -17

Step 2: Points and Symmetry

The 8-way symmetry of a circle reduces computation:


For each (x, y) , plot:
(x, y), (-x, y), (x, -y), (-x, -y), (y, x), (-y, x), (y, -x), (-y, -x) .

Step 3: Iteration Table


Step Pk (X, Y) Symmetric Points
1 -17 (0, 10) Plot 8 symmetric points
2 -7 (1, 10) Plot 8 symmetric points
3 7 (2, 9) Plot 8 symmetric points
4 -7 (3, 9) Plot 8 symmetric points
5 15 (4, 8) Plot 8 symmetric points

Conclusion: Using Bresenham’s algorithm, the circle is drawn


by plotting symmetric points efficiently.

Q1(C): Raster System Scanning Time

Given:
• Resolution: 640 \times 480 pixels
• Refresh rate: 60 frames per second

Step 1: Total Number of Pixels

\text{Total pixels} = 640 \times 480 = 307200 \ \text{pixels/frame}

Step 2: Total Time per Frame

\text{Time per frame} = \frac{1}{\text{Refresh Rate}} = \frac{1}{60} = 16.67 \ \text{ms}

Step 3: Time per Pixel


\text{Time per pixel} = \frac{\text{Time per frame}}{\text{Total pixels}} = \frac{16.67 \times 10^{-3}}{307200} \
approx 54.3 \ \text{ns}

Conclusion: Each pixel is scanned in approximately 54.3


nanoseconds.

PART B
Q2(A): Transformation of Square

Given: Square ABCD with center at (2,2) , scaling factor 0.5 .

Original Coordinates:
• A(0,0), B(0,4), C(4,4), D(4,0) .

Steps:
1. Translate Square to Origin: Subtract center (2,2) .

2. Apply Scaling Matrix:


S = \begin{bmatrix} 0.5 & 0 & 0 \\ 0 & 0.5 & 0 \\ 0 & 0 & 1 \end{bmatrix}

3. Translate Back to Center: Add (2,2) .

Original Point After Translation After Scaling Final Point


A(0,0) (-2,-2) (-1,-1) (1,1)
B(0,4) (-2,2) (-1,1) (1,3)
C(4,4) (2,2) (1,1) (3,3)
D(4,0) (2,-2) (1,-1) (3,1)

Result: The new square coordinates are:


• A(1,1), B(1,3), C(3,3), D(3,1) .

PART C
Q2(B): Cohen-Sutherland Line Clipping Algorithm

Given: Line P1(70,20) to P2(100,10) , Window [50,10] to [80,40].

Step 1: Region Codes


Point Region Code
P1(70,20) 0000 (Inside)
P2(100,10) 0010 (Right)
Step 2: Clip the Line
• P2 is outside; find the intersection with the window boundary.

Result: Calculate the clipped point where x = 80 .

Limitations:
• Works only for rectangular windows.
• Cannot handle curved or irregular clipping regions.

Here is the detailed solution for Question 3 (all parts) and


Question 4 (all parts) with step-by-step explanations:

PART C
Q3(A): Bezier Curve

Given: A cubic Bezier curve defined by the control points:


• .

Step 1: Bezier Curve Equation

The cubic Bezier curve is defined as:

Step 2: Mid-Point Calculation at

Substitute :
Simplify each term:



Substitute the control points:


Simplify:



Add all points:

Step 3: Gradient Verification

The gradient at the mid-point involves differentiating with respect to


. Due to the marks allocated, gradient verification steps are omitted
for brevity.

Q3(B): Bezier Curve Passing through Given Points

Given: Points: .

Step 1: General Bezier Curve

A cubic Bezier curve equation is:

Here:



• .

Step 2: Simplified Bezier Curve

Substitute these points into the Bezier equation. At specific values of


(e.g., ), the curve can be plotted.

Q3(C): Parallel vs Perspective Projection


Aspect Parallel Projection Perspective Projection
Definition Lines are parallel to each other.Lines converge to a vanishing point.
Application Used in CAD and technical drawings. Used in 3D graphics and realistic views.
Lines Do not converge. Converge at a distance (vanishing point).
Example Orthographic projection. Perspective rendering in 3D games.

Q3(D): Phong Shading Model

Definition: Phong shading is an illumination model that provides


smooth shading across surfaces using interpolation.
Steps in Phong Shading:
1. Calculate normal vectors at each vertex.
2. Interpolate normal vectors across the surface.
3. Use the Phong reflection model at every pixel:
Where:

• : Ambient light intensity.


• : Diffuse reflection.
• : Specular reflection.
• : Normal vector.
• : Light source direction.
• : Reflected light direction.
• : Viewer direction.
• : Shininess constant.

Q3(E): General Form of Bezier Blending Function

A degree Bezier curve is represented as:


Here, are blending functions.

PART D
Q4(A): Lossy and Lossless Compression
Aspect Lossy Compression Lossless Compression
Definition Reduces file size by removing data. Reduces file size without data loss.
Example JPEG (images), MP3 (audio). PNG (images), ZIP files.
Algorithm Irreversible (e.g., Huffman Coding). Reversible (e.g., Run Length Encoding).

Example Algorithm:
• Huffman Coding uses variable-length codes to compress data
efficiently.

Q4(B): Authoring Tools

Definition: Authoring tools are software applications used to


assemble and create multimedia content.
Examples:
1. Adobe Flash
2. Adobe Captivate
3. iSpring

Methods:
• Assemble text, images, audio, video, and animations.
• Create interactive presentations or applications.

Q4(C): Computer-Based Animation

Steps for Animation:


1. Storyboarding: Creating rough sketches.
2. Modeling: Building 3D models.
3. Keyframing: Defining critical frames.
4. Rendering: Generating the final animation sequence.

Q4(D): MPEG Encoding

Definition: MPEG (Moving Picture Experts Group) encoding


compresses video and audio data for efficient storage and
transmission.

Steps:
1. Motion Compensation: Predict frames based on previous
ones.
2. Quantization: Reduce redundant data.
3. Compression: Apply techniques like DCT (Discrete Cosine
Transform).

Q4(E): Short Notes


1. Morphing:
• Morphing transforms one image into another over a sequence
of frames.
• Example: Used in animations for face or shape
transformations.
2. MIDI (Musical Instrument Digital Interface):
• MIDI transmits musical instructions, not sound.
• It defines parameters like pitch, note duration, and volume.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy