我面临这个问题。我想创建一个 hexgrid 并能够以这种方式创建:
//grid extents
int numCols,numRows;
for (int i=0; i<numCols; ++i){
for (int j=0; j<numRows; ++j){
//x and y coordinates of my hexagon's vertices
float xpos,ypos;
//2D array storing verteces of my hextopology
vertices[i][j] = new VertexClass(xpos, ypos);
// statements to change xpos/ypos and create hex
}
}
我发现制作 hexgrid 的所有方法,首先创建一个 hex 对象,然后在网格上复制它,从而创建重复的顶点位置和连接边缘。我想避免重复顶点位置。我如何声明语句来制作这样的网格?
谢谢