I’m glad it helped and that you were able to figure out the rest
Sorry about not including the imports. I use the IntelliJ Idea IDE where I just press Alt+Enter and it adds the imports automatically. It even suggests improvements to the code
The vertices may contain between 1 and 3 parts:
- The actual vertex position. A triangle has 3 vertices (t.a, t.b, t.c) and each vertex has .x, .y and .z.
- The normal. That’s a vector pointing outwards from the vertex, used for light calculations.
- The texture coordinate. The triangle may have 3 texture coordinates (t.uvA, t.uvB, t.uvC, one for each vertex), which are 2D points representing a position on an image, also known as texture.
Probably your model has no uv mapping (textures) so it was giving you an NPE.
If you like “low poly” look you can replace the first line in the function by m.computeFaceNormals();
(or just comment out the existing line), which will make the three normals in a face equal, which basically disables smoothing.
How much did the frame rate increase?