videx-3d
Version:
React 3D component library designed for sub surface visualizations in the browser
21 lines (20 loc) • 1.07 kB
TypeScript
import { DataTexture } from 'three';
import { Vec3 } from '../../sdk';
export declare function triangleNormal(p0: Vec3, p1: Vec3, p2: Vec3): Vec3;
/**
* Encode elevation data to RGBA image values so it can be used as a data texture. Depth
* values are required by the surface material to map to color ramps and also for contours.
*/
export declare function elevationMapToRGBA(data: Float32Array, nullValue?: number): Uint8Array<ArrayBuffer>;
/**
* Calcukate and encode surface normals from an elevation grid as RGBA image values.
*/
export declare function elevationMapNormalsToRGBA(data: Float32Array, columns: number, xScale: number, yScale: number, rotation?: number, nullValue?: number): Uint8Array<ArrayBuffer>;
/**
* Create a data texture from RGBA encoded normals
*/
export declare function createNormalTexture(buffer: Uint8Array, width: number, height: number): DataTexture;
/**
* Create a data texture from RGBA encoded depth values
*/
export declare function createElevationTexture(buffer: Uint8Array, width: number, height: number): DataTexture;