void ellipse3d(Image *im, Point p, int rad, int i, Image **c, Point sp) { fillarc(im, p, rad, rad, c[0], sp, 45, 180); fillarc(im, p, rad, rad, c[1], sp, 45, -180); fillellipse(im, p, rad-i, rad-i, c[2], sp); }
void init(void *_prms) { param_set *p = (param_set *) _prms; int i, j; *p->mid = (L + 1) / 2; /* screen mid */ for (i = 0; i < L + 2; i++) for (j = 0; j < L + 2; j++) grid[i][j] = 0; grid[(int) *p->mid][(int) *p->mid] = 1; if (*p->R >= L) { while (*p->R >= L - 1) { *p->R -= dR; } } *p->src_r = 0; *p->new_r = 1; *p->rem_r = 0; *p->reset = 0; layer(*p->win, 0, 2); gsetbgcolor(*p->win, ECTRL_BGCOLOR); newcolor(*p->win, "#303030"); gclr(*p->win); fillarc(*p->win, *p->mid, *p->mid, *p->R / 2, *p->R / 2, 0, 360, 0); layer(*p->win, 0, 1); copylayer(*p->win, 2, 1); copylayer(*p->win, 1, 0); }
void human(void){// 棒人間 newpen(win, 1); fillarc(win,x, 25.0, 5.0, 5.0, 0.0, 360.0, 1); line(win, x, 5.0, PENUP); line(win, x, 20.0, PENDOWN); line(win, x, 5.0, PENUP); line(win, x-5.0, 0.0, PENDOWN); line(win, x, 5.0, PENUP); line(win, x+5.0, 0.0, PENDOWN); line(win, x, 13.0, PENUP); line(win, x-5.0, 17.0, PENDOWN); line(win, x, 13.0, PENUP); line(win, x+5.0, 17.0, PENDOWN); }
void drawFeature(unsigned i, char mini) { t_point* featurePoints; if(mini) { allLargeFeatures[i].updatepolyMiniPoints(); featurePoints = allLargeFeatures[i].getpolyPoints(); i = allLargeFeatures[i].getID(); } else { featurePoints = allFeatures[i].getpolyPoints(); } //closed features are polygons if (allFeatures[i].isClosed()) { setcolor(colorScheme[allFeatures[i].getcolorID()][colorMode]); fillpoly(featurePoints, allFeatures[i].getnPoints()); } else { //open features are lines setcolor(colorScheme[allFeatures[i].getcolorID()][colorMode]); if(mini) { for (unsigned j = 0; j < allFeatures[i].getnPoints() - 1; j ++) { drawline(featurePoints[j],featurePoints[j+1]); } } else { setlinewidth(floor(allFeatures[i].getlineWidth()/trueScreen.get_width())); setlinestyle(allFeatures[i].getlineStyle()); for (unsigned j = 0; j < allFeatures[i].getnPoints() - 1; j ++) { drawline(featurePoints[j],featurePoints[j+1]); fillarc(featurePoints[j].x,featurePoints[j].y,allFeatures[i].getlineWidth()/2200,0,360); } fillarc(featurePoints[allFeatures[i].getnPoints() - 1].x,featurePoints[allFeatures[i].getnPoints() - 1].y,allFeatures[i].getlineWidth()/2200,0,360); } } }