Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Opengl Index buffer madness

4: Adsense

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
1 reply to this topic

#1 greenzone   Members   

678
Like
0Likes
Like

Posted 16 July 2012 - 01:49 PM

how do i create an index buffer for a large mesh? i mean specifically how to i set up the array of int's from the vertex data? like what is the logic behind this? i understand what the index buffer is for and how to use it but i dont know how to set up the initial array you will pass to the gl element array buffer.
J-GREEN

Greenpanoply

#2 Fredericvo   Members   

1707
Like
1Likes
Like

Posted 16 July 2012 - 05:52 PM

how do i create an index buffer for a large mesh? i mean specifically how to i set up the array of int's from the vertex data? like what is the logic behind this? i understand what the index buffer is for and how to use it but i dont know how to set up the initial array you will pass to the gl element array buffer.

Not sure if you nean simple geometry that you manually type the numbers for or imported geometry from a 3D program but if it's the latter then it'll already be exported with indices.
If the question is about how it works then the index is simply the location in the vertex buffer to use the data from.
Example: vertex buffer
x1,y1,z1 (position)
x2,y2,z2
x3,y3,z3

Then in the index buffer a triangle would be defined as [0,1,2] and another as [1,2,3] using vertex 1 and 2 twice thereby saving space and bandwidth.




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.