Computer Graphics Lab Manual for IV CSE



There is document - Computer Graphics Lab Manual for IV CSE available here for reading and downloading. Use the download button below or simple online reader.
The file extension - PDF and ranks to the Documents category.


160

views

on

Extension: DOC

Category:

Documents

Pages: 1

Download: 45



Sharing files


Tags
Related

Comments
Log in to leave a message!

Description
Download Computer Graphics Lab Manual for IV CSE
Transcripts
BRESENHAM’S LINE DRAWING ALGORITHM Ex No: 1 a Date: Aim: To write a program in C language for Bresenham’s line drawing algorithm Algorithm: 1 Input the lines two endpoint and store the left end point in (x1,y1) and right end point in(x2,y2) 2 Load (x1,y1) into the frame buffer; (ie) plot the first point 3 Calculate constants dx, dy, 2dy and 2dy-2dx and obtain the starting value for the decision parameter as P0=2dy-dx 4 At each xk along the line, starting at k=0, perform the following test: If pkxb) { x=xb; y=yb; xend=xa; } else { x=xa; y=ya; xend=xb; } putpixel(x,y,15); while(x