高さマップ(その2)
高さマップを動的に設定する例です。データをバイト配列で設定することで動的な高さマップを設定することが可能です。
https://playground.babylonjs.com/#FZE1TM#1
https://scrapbox.io/files/67e08fb7ba11ce8f057efdc4.png
Function CreateGroundFromHeightMap
code:ts
CreateGroundFromHeightMap(
name: string,
url: string | { data: Uint8Array; height: number; width: number },
options?: {
alphaFilter?: number;
colorFilter?: Color3;
height?: number;
maxHeight?: number;
minHeight?: number;
onError?: (message?: string, exception?: any) => void;
onReady?: (mesh: GroundMesh, heightBuffer?: Float32Array) => void;
passHeightBufferInCallback?: boolean;
subdivisions?: number;
updatable?: boolean;
width?: number;
},
scene?: Nullable<Scene>,
): GroundMesh
Created by cx20.icon
#作ってみた #Playground #高さマップ #Claude #earth