Cheap cube made out of simple triangles
The Triangles class is used to construct a cube from triangles. Corner positions are defined only once and connected by indices efficiently. The cube is lit and the normals are shared between adjacent edges (hence the light looks a little funky here). A LineStrip object is used to emphasize the edges of the cube.
This example demonstrates the trade off one often has to make when building large...huge scenes. The cube here is constructed by sharing vertices which can lead to improved performance when a large number of such cubes are to be rendered. However, the vertex sharing comes with limitations in configurability and brings disadvantages in lighting.
See also: Visualization documentation online.
Last modified: August 25 2021 18:29