Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Cube() {
- faces = new Shape3D[6]; //yes there are more faces than just this one, but they're all the same, aside from vertices
- QuadArray qa1 = new QuadArray(4, QuadArray.COORDINATES | QuadArray.TEXTURE_COORDINATE_2);
- qa1.setCapability(QuadArray.ALLOW_TEXCOORD_READ);
- qa1.setCapability(QuadArray.ALLOW_TEXCOORD_WRITE);
- float[] coordinates1 = {-0.5f,-0.5f,-0.5f, 0.5f,-0.5f,-0.5f, 0.5f,-0.5f,0.5f, -0.5f,-0.5f,0.5f}; //bottom face
- qa1.setCoordinates(0, coordinates1);
- applyTextureCoords(qa1); //apply our coordinates
- faces[0] = new Shape3D(qa1);
- ...
- }
- //...
- public void applyTextureCoords(QuadArray array) {
- float[] textureCoordinates = {0.0f,0.0f, 1.0f,0.0f, 1.0f,1.0f, 0.0f,1.0f}; //all of them are going to be the same
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement