sorry if I missed it, but I couldn't find any related topic, so I created this thread.
I want to create a black cube with texture on only one side.
Here's my current data:
- Code: Select all
// Board vertices.
private float[] vertices = {
-3.0f, 0.1f, 2.0f, // 0
-3.0f, -0.1f, 2.0f, // 1
3.0f, -0.1f, 2.0f, // 2
3.0f, 0.1f, 2.0f, // 3
3.0f, -0.1f, -2.0f, // 4
3.0f, 0.1f, -2.0f, // 5
-3.0f, -0.1f, -2.0f, // 6
-3.0f, 0.1f, -2.0f, // 7
};
// Board indices.
private short[] indices = {
0, 1, 2,
0, 2, 3,
3, 2, 4,
3, 4, 5,
5, 4, 6,
5, 6, 7,
7, 1, 0,
7, 6, 1,
7, 0, 3,
7, 3, 5,
6, 2, 1,
6, 4, 2,
};
// UV coordinates.
private float[] uvCoordinates = {
0.0f, 1.0f, // 0
0.0f, 0.0f, // 1
0.0f, 0.0f, // 2
1.0f, 1.0f, // 3
0.0f, 0.0f, // 4
1.0f, 0.0f, // 5
0.0f, 0.0f, // 6
0.0f, 0.0f, // 7
};
As you can see, I have exact same amount of UV coordinates as I have vertices.
Currently this renders texture where I want it to, but also renders some garbage around cube.
Can anyone tell me if there's some other way around?
Figured that creating different plane would require more resources, which I already lack




I am going to be visiting here as much as I can. Hope to get a developer blog running at some point w/ some coding tutorials and practical advice with what little I do have to offer. Cya round the boards 
