1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| // 创建一个金字塔 vector pos1 = set(1,0,1); vector pos2 = set(-1,0,-1); vector pos3 = set(-1,0,1); vector pos4 = set(1,0,-1);
int p1 = addpoint(0, pos1); int p2 = addpoint(0, pos2); int p3 = addpoint(0, pos3); int p4 = addpoint(0, pos4);
int prim1 = addprim(0, "poly");
addvertex(0, prim1, p1); addvertex(0, prim1, p3); addvertex(0, prim1, p2); addvertex(0, prim1, p4);
vector pos = {0,2,0}; int p = addpoint(0, pos);
int prim2 = addprim(0, "poly"); addvertex(0, prim2, p); addvertex(0, prim2, p1); addvertex(0, prim2, p3);
int prim3 = addprim(0, "poly"); addvertex(0, prim3, p); addvertex(0, prim3, p4); addvertex(0, prim3, p1);
int prim4 = addprim(0, "poly"); addvertex(0, prim4, p); addvertex(0, prim4, p2); addvertex(0, prim4, p4);
int prim5 = addprim(0, "poly"); addvertex(0, prim5, p); addvertex(0, prim5, p3); addvertex(0, prim5, p2);
|