Draw line segment - digital differential analyzer algorithm, Computer Graphics

Assignment Help:

1. By using Digital Differential Analyzer algorithm draw line segments from point (1,1) to (9,7).

Ans. We see that the usual equation of the line is specified by:

y = mx+c, here m = (y1 - y0/( x1 - x0)

Specified (x0, y0) → (1, 1) ; (x1, y1) → (9, 7)

⇒ m = (7-1)/(9-1) =6/8

C = y1 - mx1 = 7 - (6/8) *9 = 1/4

Consequently, by equation of line (y = mx + c) we contain: 

 y = (6/8)x+(1/4)

  Digital Differential Analyzer Algorithm Two case:

Case 1:   m < 1   

xi + 1 = xi + 1

 yi + 1 = yi + m

Case 2: m > 1   

xi + 1 = xi + (1/m)

yi + 1 = yi + 1

Here m < 1 so as per to Digital Differential Analyzer algorithm case 1

xi + 1 = xi + 1; yi + 1 = yi + m

Specified (x0, y0) = (1, 1)

1) x1 = x0 + 1 = 2

y1 = y0 + m = 1+ (6/8) = 7/4

Place pixel (x0, round y, colour)

That is, put on (2, 2)

Likewise, go on until (9, 7) is arrived at.


Related Discussions:- Draw line segment - digital differential analyzer algorithm

Define the term avatars- animation, Define the term Avatars- Animation ...

Define the term Avatars- Animation Avatars are another instance of animation. These are frequently used to represent people either in 3-D (as used in computer games) and in 2-D

What is riged body transformation matrix, What is riged body transformation...

What is riged body transformation matrix? Show that the composition lf two rotation is additive by concatenating the matrix representation of r (theta 2 ) = R (theta1 + theta 2 ) t

Method to draw an object by using four bézier curves, Suggest a method to d...

Suggest a method to draw an object as in figure using four Bézier curves of suitable degree Answer: Employ four quartic Bézier curves with the endpoint of one as the initial poi

Differentiate between z-buffer method and scan-line method, Differentiate b...

Differentiate between z-buffer method and scan-line method. What is the visibility test made in these methods? Solution : In depth buffer algorithm every pixel location on the

Ray casting - polygon rendering and ray tracing methods, Ray Casting -polyg...

Ray Casting -polygon rendering and ray tracing methods It is a method wherein the surfaces of objects visible to the camera are determined by throwing or say casting rays of

B splines, What is uniform rational splines

What is uniform rational splines

Reflection, Determine the transformation matrix for the reflection, Compute...

Determine the transformation matrix for the reflection, Computer Graphics

Bezier surfaces - modeling and rendering, Bezier Surfaces - Modeling and Re...

Bezier Surfaces - Modeling and Rendering Two sets of Bezier curve can be utilized to design an object surface by identifying by an input mesh of control points. The Bézier su

List of 3-d animation software, List of 3-D Animation Software Here is ...

List of 3-D Animation Software Here is a short list of several 3-D animation software are - Softimage ( Microsoft) -  Alias/Wavefront ( SGI) -  3D studia MAX (Autodesk

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd