VBO cube and texturing it...

Started by pfolder, June 01, 2012, 19:58:51

Previous topic - Next topic

pfolder

Hey all, new to the forum and I am hoping that I could get some help.  I understand how to make a cube in the immediate mode and Display Lists of lwjgl, and now I am trying to learn VBOs.  I got my texturing to work on my cube when I used the 6 faces as the vertices, and now I am just trying to use the 8 cubes vertices in order to texture it, but it doesn't seem to work for me.  Whenever I open it, the only part that actually gets textured are the floor and ceiling of the room I made.

  • float vertexes[] = {GRID_SIZE, FLOORHEIGHT, GRID_SIZE, GRID_SIZE, FLOORHEIGHT, -GRID_SIZE,
              -GRID_SIZE, FLOORHEIGHT, -GRID_SIZE, -GRID_SIZE, FLOORHEIGHT, GRID_SIZE, 
              -GRID_SIZE, HEIGHT, GRID_SIZE, -GRID_SIZE, HEIGHT, -GRID_SIZE,
              GRID_SIZE, HEIGHT, -GRID_SIZE, GRID_SIZE, HEIGHT, GRID_SIZE,};
       float texturepoints[] = {5, 6.66f, 5, 3.33f, 2.5f, 3.33f, 2.5f, 6.66f, 10, 6.66f, 10, 3.33f,
             7.5f, 3.33f, 7.5f, 6.66f};
Thanks for any help that you can give me on this.  In relation to this, I have been trying to figure how to do UV mapping with VBOs or any other type of lwjgl coding, and is there any good tutorial for that because I cannot find any that I can understand :P