triangleRasterizeDepth
import { triangleRasterizeDepth } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Overloaded version of triangleRasterize() with depth-only rendering
triangleRasterizeDepth(vertices: Mat, indices: Mat, depthBuf: Mat, world2cam: Mat, fovY: number, zNear: number, zFar: number, settings: TriangleRasterizeSettings): void;2 available overloads
triangleRasterizeDepth(vertices: Mat, indices: Mat, depthBuf: Mat, world2cam: Mat, fovY: number, zNear: number, zFar: number): void;triangleRasterizeDepth(vertices: Mat, indices: Mat, depthBuf: Mat, world2cam: Mat, fovY: number, zNear: number, zFar: number, settings: TriangleRasterizeSettings): void;verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
depthBufInput/output value, modified by the native operation. an array of floats containing resulting Z buffer. Should contain float values and be the same size as colorBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene. Empty scene corresponds to all values set to zFar (or to 1.0 in INVDEPTH mode)
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.