Original Post
Sorry to bother you guys again.....
but my Edge function (the one that fills the edgebuffer)
doesnt work, and I cant see whats wrong with it.
Please help, thanks in advance
here it is:
void Edge(int leftedge[],int rightedge[],ePixel v1,ePixel v2)
{
float deltax,deltay;
float slope;
float x;
int y;
ePixel temp;
if(v1.y > v2.y) {temp = v1;v1=v2;v2=temp;}
deltax = v2.x - v1.x;
deltay = v2.y - v1.y;
slope = deltax / deltay;
x = v1.x;
for(y = v1.y;y < v2.y;y++)
{
if(x < leftedge[y])
leftedge[y] = (int)x;
if(x > rightedge[y])
rightedge[y] = (int)x;
x += slope;
}
}
|