Custom Scene Node help!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Distorion
Posts: 12
Joined: Thu Jul 19, 2012 1:58 am
Location: Canberra, Australia

Custom Scene Node help!

Post by Distorion »

Hey, This is proberbly abit of a newb question.

To help me learn more i decided to have a crack at a custom scene node. everything makes sense to me except this part:

"u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 };"

I have no idea what the indices are or what there used for, I've done some searching around and the best i could find was that it determines draw Order of the vertex's, If so how does that work?

Thank you for your time!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Custom Scene Node help!

Post by hybrid »

Not just draw order, but they actually define which vertices are used at which point. Since you draw triangles usually, in your example vertices (0,2,3) are used to create the first triangle. The triangle is drawn in that order. Next tri is (2,1,3). Here comes the bonus: You only need four vertices, although you draw six. But vertex 2 is re-used and moreover avoids seams this way, as there is no gap between the adjacent vertices - they are exactly the same.
Distorion
Posts: 12
Joined: Thu Jul 19, 2012 1:58 am
Location: Canberra, Australia

Re: Custom Scene Node help!

Post by Distorion »

Awesome thanks for the reply. Exactly what i needed to know.^^
Post Reply