Starting from:

$25

ComputerGraphics - A14 – UV coordinates - Solved

The goal of the application contained in index.html, is to create 3 objects:

 

1.      An Egyptian pyramid

 

  

 

2.      A dice

 

  

 

3.      A soda can

 

  

 

Models are created in file models.js. In particular, the procedure addMesh()receives as parameters the vertex buffer (an array of eight elements with the coordinates of the vertices, the direction of the associated normal vectors, and the values of the UV coordinates), 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 cylinder for the soda can should be generated by an algorithm (which requires at least two nested loops are required). The pyramid and the cube for the dice might instead be manually defined. All models share the same texture: file TextureRef.pdf, enclosed in the folder, shows the texture on a grid that should help in finding the right UV coordinates for the primitives.

 

  

 

In the application, the mouse turns the view, and the slider at the bottom of the page can be used to change the objects being displayed. To help you in the creation of objects, it is possible to toggle a wireframe view pressing the space bar key. Space key also provides a view where the normal vector directions or UV coordinates are visually represented by changing the colors of the surface.  

More products