+ All Categories
Home > Documents > CS2405 Computer Graphics Lab Manual

CS2405 Computer Graphics Lab Manual

Date post: 29-Oct-2015
Category:
Upload: dhilip-prabakaran
View: 2,403 times
Download: 17 times
Share this document with a friend
Description:
CG Lab Manual
Popular Tags:

of 70

Transcript

INDEX

Ex.

NoDateName of the ExperimentP. NoSign

1BRESENHAMS LINE DRAWING ALGORITHM

2BRESENHAMS CIRCLE DRAWING ALGORITHM

3BRESENHAMS ELLIPSE DRAWING ALGORITHM

4OUTPUT PRIMITIVES

5TWO DIMENSIONAL TRANSFORMATION

6COMPOSITE TWO DIMENSIONAL TRANSFORMATION

7COHEN SUTHERLAND 2D LINE CLIPPING

8WINDOWING TO VIEWPORT MAPPING

9SUTHERLAND HODGEMANN POLYGON CLIPPING ALGORITHM

10THREE DIMENSIONAL TRANSFORMATION

11COMPOSITE THREE DIMENSIONAL TRANSFORMATION

12Generating Fractal images

EX NO: 1

BRESENHAMS LINE DRAWING ALGORITHMDATE:

Aim:To write a C program to draw a line using Bresenhams Algorithm.

Algorithm:

Step 1:Start the program. Step 2:Input the two endpoints (x1,y1) and (x2,y2).

Step 3:Plot the pixel value (x1,y1) with a specified color.

Step 4:Calculate the value of dx and dy and find the starting value of decision parameter asdp=2*dy-dx.Step 5:Calculate the values of s1 and s2 depending on (x1,y1) and (x2,y2) values.

Step 6:If dpx2)

{

x=x2;

y=y2;

xend=x1;

}

else

{

x=x1;

y=y1;

xend=x2;

}

putpixel(x,y,2);

for(i=x;i


Recommended