Computer Graphics Lab Manual for IV CSE
Embed Size (px)
This Lab manual contain the entire program of Computer graphics and is useful for engineering students
BRESENHAMS LINE DRAWING ALGORITHMEx No: 1 a
To write a program in C language for Bresenhams line drawing 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; (i.e) plot the first point.
3. Calculate constants dx, dy, 2dy and 2dy-2dx and obtain the starting value for the decision parameter as
4. At each xk along the line, starting at k=0, perform the following test: