Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Re: My Bresenham like line plotting algorithm



code correction:

void LineM(int x1,int y1,int x2,int y2)


{
int x,y,d,dx,dy;
y=y1;
dy=y2-y1;
dx=x2-x1;
d=0;
for(x=x1;x<=x2;x++)


{
if ((d<<1)>=dx)
putpixel(x,y+1);
else
putpixel(x,y);

d+=dy;
if (d>=dx)


{
y++;
d-=dx;
}//if d>=dx
}//for
}//lineM


Reply


View All Messages in comp.graphics.algorithms

path:
My Bresenham like line plotting algorithm =>

Replies:

Copyright 2006 WatermarkFactory.com. All Rights Reserved.