void sthickline (V2d a, V2d b, float w, CT c) { V2d a2b=w/2.0*(b-a).norm(); V2d p=a2b.perp(); filltri(a+p,a-p,b+p,c); filltri(a-p,b+p,b-p,c); // error("Writeable::sthickline not cast before write"); }
void thicklinev (V2d a, V2d b, float w, CT c) { V2d p=V2d(w/2.0,0); V2d a2b=V2d(0,w/2.0)*mysgn(b.y-a.y); filltri(a-a2b+p,a-a2b-p,b+a2b+p,c); filltri(a-a2b-p,b+a2b+p,b+a2b-p,c); // error("Writeable::vthickline not cast before write"); }
void thicklineh (V2d a, V2d b, float w, CT c) { V2d p=V2d(0,w/2.0+1); V2d a2b=V2d(w/2.0-1,0)*mysgn(b.x-a.x); filltri(a-a2b+p,a-a2b-p,b+a2b+p,c); filltri(a-a2b-p,b+a2b+p,b+a2b-p,c); // error("Writeable::hthickline not cast before write"); }
void doprim( /* plot primitive */ PRIMITIVE *p ) { switch (p->com) { case PMSTR: printstr(p); break; case PVSTR: plotvstr(p); break; case PLSEG: plotlseg(p); break; case PRFILL: fillrect(p); break; case PTFILL: filltri(p); break; case PPFILL: fillpoly(p); break; case PSEG: doseg(p); break; default: sprintf(errmsg, "unknown command '%c' in doprim", p->com); error(WARNING, errmsg); return; } newpage = FALSE; }
void main() { int i; int buf[20][28]; long l; time(&l); sRand(l); filltri(buf); Initialise(); for(i = 0; i < 5; i++) { plottri(buf[i], 28, 1, 7 + 13*i, 0); plottri(buf[i+5], 28, 0, 7 + 13*i, 12); plottri(buf[i+10], 28, 1, 14 + 13*i, 7); plottri(buf[i+15], 28, 0, 14 + 13*i, 19); } getch(); closegraph(); restorecrtmode(); }
void thickline(V2d a,V2d b,CT r,float w) { V2d a2b=w/2.0*(b-a).norm(); V2d p=a2b.perp(); filltri(a+p,a-p,b+p,r); filltri(a-p,b+p,b-p,r); }
void filltri (V2d a, V2d b, V2d c, CT col) { filltri(a.x,a.y,b.x,b.y,c.x,c.y,col); // error("Writeable::filltri not cast before write"); }