In this lab you give the user the power to manipulate their view of an object using their mouse or other pointing device. You will add a trackball interface to a renderer that loads a mesh from a file.
Your first challenge is to render a mesh described in a JSON file with this general structure:
{
"positions": [
0, 0, 0,
1, 0, 0,
...
],
"normals": [
0, 1, 0,
0, 1, 0,
...
],
"indices": [
0, 1, 3,
0, 3, 2,
...
]
}
Follow these steps to get your renderer up and running:
fetch
.
lightDirection
. Ignore the ambient and specular terms.
Your second challenge is to add a trackball interface to your renderer. Follow these steps:
trackball.js
. Export the class and import it in your renderer.
worldFromModel
uniform.