Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for newer THREE.js versions (ES6) #38

Open
oliver408i opened this issue Jun 29, 2024 · 1 comment
Open

Update for newer THREE.js versions (ES6) #38

oliver408i opened this issue Jun 29, 2024 · 1 comment

Comments

@oliver408i
Copy link

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).

  1. 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)
  2. Instead of THREE.Terrain, a separate object needs to be made, such as window.THREETerrain
  3. 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"

@IceCreamYou
Copy link
Owner

Sure, thanks for looking into it. I'd be happy to review a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants