Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.74 KB | None | 0 0
  1. public Cube() {
  2.     faces = new Shape3D[6]; //yes there are more faces than just this one, but they're all the same, aside from vertices
  3.     QuadArray qa1 = new QuadArray(4, QuadArray.COORDINATES | QuadArray.TEXTURE_COORDINATE_2);
  4.     qa1.setCapability(QuadArray.ALLOW_TEXCOORD_READ);
  5.     qa1.setCapability(QuadArray.ALLOW_TEXCOORD_WRITE);
  6.     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
  7.     qa1.setCoordinates(0, coordinates1);
  8.     applyTextureCoords(qa1); //apply our coordinates
  9.     faces[0] = new Shape3D(qa1);
  10.     ...
  11. }
  12.  
  13. //...
  14. public void applyTextureCoords(QuadArray array) {
  15.         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
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement