- Real-Time 3D Graphics with WebGL 2
- Farhad Ghayour Diego Cantor
- 64字
- 2021-06-10 19:42:58
Have a Go: Rendering Using drawArrays
Our square was defined using drawElements via vertices and indices. Go ahead and render the same square using drawArrays.
Hint
Given that you don't use indices with drawArrays, you won't need an IBO. So, you will need to duplicate vertices to construct this geometry.
Given that you don't use indices with drawArrays, you won't need an IBO. So, you will need to duplicate vertices to construct this geometry.
Hint
For reference, you can find the source code for this exercise in ch02_02_square-arrays.html.
For reference, you can find the source code for this exercise in ch02_02_square-arrays.html.