WebGL experiment part 2
2013-09-29Last modified on 2021-05-24
Part 2 ! OMG !
This is a very small update, and we are going to draw this:
(image from NeHe website)
The demo page is here and the code is here.
We are using the code from experiment01.
We are just adding the colors in our
var colors = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];
Then, we load them into the mesh:
That's it !
Same thing here. Adding:
var colors = [ 0.5, 0.5, 1, 0.5, 0.5, 1, 0.5, 0.5, 1, 0.5, 0.5, 1 ];
I don't know yet how to not repeat the color for the square... Do you have an idea ?
See you on part 3 !#webgl