Skip to content

Function: sortTrianglesByDepth() ​

ts
function sortTrianglesByDepth(centroids, modelView, order?): Uint32Array;

Experimental

Triangle draw order, farthest first. centroids holds 3 floats per triangle in the mesh's local space (NaN: invalid, drawn first); modelView is the column-major model-view matrix (only its third row, the view-space z, is read). Returns order (triangle indices).

Parameters ​

ParameterType
centroidsFloat32Array
modelViewArrayLike<number>
orderUint32Array

Returns ​

Uint32Array

Released under the MIT License.