Hey there, I’m currently attempting to create a TextureAtlas from a Box2d shape’s vertices. Having filled my vertices, how would I create a ccV3F_C4B_T2F_Quad and subsequently use CCTextureAtlas::insertQuad to create a textured polygon. I’m assuming utilising the CCTextureAtlas class is recommended.

This is how I’m setting the texture coordinates and the vertices, is this correct? My main query however, is how should I be setting the colour?

[[quad.tl.vertices.x = fixShape~~>GetVertex.x;

quad.tl.vertices.y = fixShape~~>GetVertex(0).y;

quad.tl.vertices.z = 0.0f;

quad.tl.texCoords.u = 0.0f;

quad.tl.texCoords.v = 1.0f;

quad.bl.vertices.x = fixShape~~>GetVertex.x;

quad.bl.vertices.y = fixShape~~>GetVertex(1).y;

quad.bl.vertices.z = 0.0f;

quad.bl.texCoords.u = 0.0f;

quad.bl.texCoords.v = 1.0f;

quad.tr.vertices.x = fixShape~~>GetVertex.x;

quad.tr.vertices.y = fixShape~~>GetVertex(2).y;

quad.tr.vertices.z = 0.0f;

quad.tr.texCoords.u = 0.0f;

quad.tr.texCoords.v = 1.0f;

quad.br.vertices.x = fixShape~~>GetVertex.x;

quad.br.vertices.y = fixShape~~>GetVertex(3).y;

quad.br.vertices.z = 0.0f;

quad.br.texCoords.u = 0.0f;

quad.br.texCoords.v = 1.0f;]]