Texture mapping single 3D object with one draw call

Posts: 75
Joined: 2009.01
Post: #1
I cannot seem to be able to texture map from one spritesheet with different iamges for different sides of a cube with one draw call.
I can accomplish this using 6 glDrawArrays call for each side and binding different parts of the spritesheet with each call.

Any advice on this would be helpful, thanks.
Quote this message in a reply
Posts: 1,563
Joined: 2003.10
Post: #2
Ought to be simple. Use GL_QUADS or GL_TRIANGLES (not one of the types like GL_TRIANGLE_STRIP that shares vertices between primitives), and pass different texture coordinates in your texCoord array for each face you draw.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Mapping 2D texture to multiple GL_TRIANGLES ardowz 4 8,934 Feb 27, 2017 11:09 PM
Last Post: Nicolredmay
  Draw to texture using FBOs - aspect ratio issues Madrayken 2 6,599 Jul 15, 2010 11:47 AM
Last Post: Madrayken
  Changing Uniform Variables for a Single Shader reapz 3 9,147 Jul 15, 2010 01:29 AM
Last Post: dazza
  Texture Mapping: Loading a texture from a .bmp file? ishrock 5 10,506 Dec 13, 2008 09:27 AM
Last Post: ThemsAllTook
  Single buffered window Rasterman 9 8,728 Oct 15, 2007 10:40 AM
Last Post: ThemsAllTook