videx-3d
Version:
React 3D component library designed for sub surface visualizations in the browser
16 lines (15 loc) • 770 B
TypeScript
import { DataTexture } from 'three';
import { Vec3 } from '../../sdk';
export declare function triangleNormal(p0: Vec3, p1: Vec3, p2: Vec3): Vec3;
/**
* 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: Float32Array, width: number, height: number): DataTexture;