我有一个高度和宽度,我正在尝试用它们生成一个四边形。当我这样做时:
vector<Point2D> vertices;
vector<unsigned int> indices;
Point2D topLeft = Point2(0, height);
Point2D topRight = Point2(width, height);
Point2D bottomLeft = Point2(0, 0);
Point2D bottomRight= Point2(width, 0);
indices.push_back(0);
indices.push_back(1);
indices.push_back(2);
indices.push_back(0);
indices.push_back(2);
indices.push_back(3);
vertices.push_back(topLeft);
vertices.push_back(topRight);
vertices.push_back(bottomLeft);
vertices.push_back(bottomRight);
我得到一个三角形而不是四边形。但是当我这样做时:
vector<Point2D> vertices;
vector<unsigned int> indices;
Point2D topLeft = Point2(-width, height);
Point2D topRight = Point2(width, height);
Point2D bottomLeft = Point2(width, -height);
Point2D bottomRight= Point2(-width, -height);
indices.push_back(0);
indices.push_back(1);
indices.push_back(2);
indices.push_back(0);
indices.push_back(2);
indices.push_back(3);
vertices.push_back(topLeft);
vertices.push_back(topRight);
vertices.push_back(bottomLeft);
vertices.push_back(bottomRight);
它工作得很好。出了什么问题?我认为右下角?