1

I have created a terrain via a heightmap in Three.js and am using mrdoob's misc_controls_pointerlock for collision and movement. However, when I do objects.push(terrainobj); the performance goes down to about 3fps (from around 60) and there is no collision with the terrain. The collision is achieved via rays. How can I get around this?

4

1 に答える 1

1

それが単なる高さマップである場合は、レイの使用を避け、ビットマップで衝突チェックを行うことができます (キャンバスとイメージデータを使用)。

ハイトマップの XZ ワールド位置を XY ピクセルに変換するだけです。次に、ワールド内の Y 位置がピクセルのカラー バリューよりも低い場合は、オブジェクトを上に移動します。

于 2013-03-28T18:33:16.260 に答える