Convert a “normal” rectangle to a set of GLes vectors?
问题 How would I convert a "normal" rectangle into a set of OpenGL ES vertices. I'm not good at geometry so I have no idea how vertices work, and I want to be able to manipulate rectangles without having to work out the values for the vertices by trial and error. I basically need to convert this structure: typedef struct __nrect { float width; float height; float depth; /* center */ float x; float y; float z; } simple3dRect; To something like this: const GLfloat cubeVertices[6][12] = { { 1,-1, 1,