5/5 – (1 vote)
A10 Indexed primitiecs
The goal of the application contained in index.html, is to create two meshes: the surface defined by equation y = sin(x) * cos(z) with -3 <= x <= 3 and -3 <= z <= 3, and a half-sphere. Models are created in file models.js. In particular, the application uses the procedure addMesh(), that receives as parameters the vertex buffer (an array of three elements vectors with the coordinates of the vertices), the index buffer (an array of indices in the vertex buffer), and an RGB color (a three-elements array, with the value of the red, green and blue components of the color, each one in the 0-1 range). Primitives are encoded as indexed triangle lists.
The two meshes should be generated by an algorithm (which requires at least two nested loops are required). Below you can see a picture of the expected result.
Reviews
There are no reviews yet.