// Vertex positions as sequence of x, y, z
const posArr = new Float32Array([
quad.p1.x, quad.p1.y, 0,
quad.p2.x, quad.p2.y, 0,
quad.p3.x, quad.p3.y, 0,
quad.p4.x, quad.p4.y, 0,
quad.p1.x + 200, quad.p1.y, 0,
quad.p2.x + 200, quad.p2.y, 0,
quad.p3.x + 200, quad.p3.y, 0,
quad.p4.x + 200, quad.p4.y, 0
]);
// Texture co-ordinates as sequence of u, v
const uvArr = new Float32Array([
rcTex.left, rcTex.top,
rcTex.right, rcTex.top,
rcTex.right, rcTex.bottom,
rcTex.left, rcTex.bottom,
rcTex.left, rcTex.top,
rcTex.right, rcTex.top,
rcTex.right, rcTex.bottom,
rcTex.left, rcTex.bottom
]);
// Indices of vertices in sequence i, j, k
const indexArr = new Uint16Array([
0, 1, 2,
0, 2, 3,
4, 5, 6,
4, 6, 7,
]);
renderer.drawMesh(posArr, uvArr, indexArr);