In one of my earlier posts, I mentioned that I wanted to learn more about WebGL, and I would start my journey by rendering a pentagon. I chose to modify the example application at learningwebgl.com as a way to get familiar with some of the concepts. Unfortunately, I was delivered a setback when I attempted to update the gl-matrix library used for vector and matrix mathematics and found the gl-matrix api had changed. I then decided to try to modify one of the basic examples from the book Professional WebGL. The example renders a white triangle on a black buffer and I wanted to modify the example to render a red pentagon on a blue buffer. I was able to render a red triangle on a blue buffer, but for some reason I’m only able to render three vertices no matter how many vertices I add to the array.
↧