Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


OpenGL Texture Coordinates


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Hairu   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2001 - 10:55 AM

I need help getting the texture coordinate arrays to work properly in OpenGL. this is the content of my coordinate array 1.000000 1.000000 0.000000 1.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 1.000000 0.000000 I call this array like the following glTexCoordPointer(2, GL_FLOAT, 0, TexCoords); Here is the output... On left is what it should look like, the right is what i''m actually getting It might be worth noting that I use indexed vertex arrays. This is what the vertex array looks like... 1.000000 1.000000 0.000000 1.000000 -1.000000 0.000000 -1.000000 -1.000000 0.000000 -1.000000 1.000000 0.000000 this is what the index array looks like.... 0 3 2 0 2 1 it is called like this.... glVertexPointer(3, GL_FLOAT, 0, Vert_public); glDrawElements(GL_TRIANGLES, header.numFaces*3, GL_UNSIGNED_INT, index); ''Vert_public'' is the vertex array, and ''index'' is the index array. I''m so very desperate right now, any assistance at all is helpful, i''ve been over this a million times, and can''t figure it out.

Sponsor:

#2 Hairu   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2001 - 02:16 PM

any ideas?

#3 xyzzy00   Members   -  Reputation: 307

Like
Likes
Like

Posted 25 November 2001 - 03:03 PM

Seems strange to me that you are treating your position array as indexed, but your texcoord array as non-indexed. Is this right?

xyzzy

#4 Bad Monkey   Members   -  Reputation: 145

Like
Likes
Like

Posted 25 November 2001 - 03:21 PM

yeah... each vertex can have only one texture-coord/normal/colour/etc ... so you should only have 4 texture-coords (8 values) in your array.

If you want to use different tex-coords for the same vertices, you must have separate tex-coord arrays, and make extra calls to glDrawElements (changing the tex-coord pointer between these calls)... pain in the arse, I know, but its the only way to do it using vertex arrays




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS