THREE.Terrain
THREE.Terrain copied to clipboard
Update for newer THREE.js versions (ES6)
As of r165, importmaps and es6 import statements must be used in Three.js. Additionally, the THREE module can no longer be extended. Instead, I had to come up with some edits (and workarounds).
- mesh.geometry.computeFaceNormals(); had to be removed, I'm not too sure what the exact effect is, terrain works fine without it (its undefined now)
- Instead of THREE.Terrain, a separate object needs to be made, such as window.THREETerrain
- I haven't been able to fully convert this to a module, instead, we need to assign the THREE module from a es6 (import * as THREE from 'three'; window.THREE = THREE), then change THREE to window.THREE
I can make a PR if there is interest in this current state of "revision"