HUGE UPDATE
I optimised the engine to literally be 50 times faster.
@Kiwiphoenix364 the problem was not calculating the vertices, the slowdown was from sorting the triangles with the sortarray thingy, so I used a different way of sorting the triangles array.
14 Likes