Skip to main content
GameDev.net gamedev.net
🔒 Locked

Index array fun

Started by Cityhunter Jan 10, 2003 at 2:15 PM 2 replies 450+ views
Original Post
Cityhunter
Cityhunter
I''m trying to use glDrawElement to rendering objects. The object is broken down to vertex array, normal array and texture coord array. Using vertex normals I have the vertex array and normal array be the same size. The texture coord array however is larger. Since glDrawElement only takes in one index array how can I get the texture coord array also working with the same index? Does glDrawElement even support textures? I could write a for loop that loops through all the arrays but that''s a lot slower, any ideas?
_DarkWIng_
_DarkWIng_
all arrays (vrtex, normal, texture0-7, color....) must have same number of elements for VA(R) to work. If you wnat to have same vertex with 2 diferent texture coordinats then you have to duplicate vertex(and normal if used).

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Structural
Structural
I also have a little question regarding this:
Can I leave out the index array in some way when I draw the vertices? So far I''ve always ended up with an index array whose values are the same as the indexes.
STOP THE PLANET!! I WANT TO GET OFF!!
Martee
Martee
Use glDrawArrays() instead of glDrawElements().
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.