Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure I understand your question.</p> <p>TeapotIndices should be a collection of indices indicating the order in which you want your vertices to be rendered.</p> <p>For instance, let's say you have an object made out of three vertices (a triangle):</p> <pre><code>0.0, 0.0, 0.0 //index 0, lower left corner 0.5, 0.5, 0.0 //index 1, top corner 1.0, 0.0, 0.0 //index 2, lower right corner </code></pre> <p>You specify in the indices collection/array the order in which you want them rendered. Say you want your triangle to be rendered counterclockwise, you'll specify your indices as</p> <pre><code>0,2,1 </code></pre> <p>glDrawElements will then draw the lower left corner first, then the lower right corner, and finally the top corner</p> <p>Of course this doesn't make much sense when just one triangle is involved, but suppose you wanted to add another triangle that mirrors the first one downwards. This means they touch at the first triangle's bottom. Instead of specifying three vertices for that one again, you only need to add the one that is different to your vertices:</p> <pre><code>0.0, 0.0, 0.0 //index 0, lower left corner for first triangle 0.5, 0.5, 0.0 //index 1, top corner for first triangle 1.0, 0.0, 0.0 //index 2, lower right corner for first triangle 0.5, -0.5, 0.0 //new: index 3, bottom corner of a "mirrored" triangle </code></pre> <p>And you would have your indices like this:</p> <pre><code>0,2,1, 2,0,3 // ^^^^^ second triangle vertex indices </code></pre> <p>See, we've added a whole second triangle with only one new vertex, and re-used two of the old vertices for the new triangle.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload