Converts a TRIANGLE_STRIP or TRIANGLE_LOOP Primitive to TRIANGLES, which is more widely supported. Any other topology given as input (points or lines) will throw an error.
Example:
import { convertPrimitiveToTriangles } from '@gltf-transform/functions'; console.log(prim.getMode()); // 5 (TRIANGLE_STRIP) convertPrimitiveToTriangles(prim); console.log(prim.getMode()); // 4 (TRIANGLES)
Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.
Converts a TRIANGLE_STRIP or TRIANGLE_LOOP Primitive to TRIANGLES, which is more widely supported. Any other topology given as input (points or lines) will throw an error.
Example:
import { convertPrimitiveToTriangles } from '@gltf-transform/functions'; console.log(prim.getMode()); // 5 (TRIANGLE_STRIP) convertPrimitiveToTriangles(prim); console.log(prim.getMode()); // 4 (TRIANGLES)