How to create cube using single mesh in libgdx
java, libgdx
Solution
Sure you can create single mesh for cube. Check out SimpleVertexShader test in libGDX tests. It uses Shapes.genCube() to create cube mesh.
Problem
To draw a cube which has 6 sides using libgdx need 6 meshes. But it increases time as per each mesh while rendering. my code : ``` for(int i=0; i<6; i++) { faces[i].setvertices(new float[] {x,y,z,color}; } ``` So, can we create a cube using single mesh rather than 6? Thanks.