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

when updating to three.js 0.121.1 atmosphere does not longer work #67

Open
zen85 opened this issue Dec 28, 2022 · 1 comment
Open

when updating to three.js 0.121.1 atmosphere does not longer work #67

zen85 opened this issue Dec 28, 2022 · 1 comment

Comments

@zen85
Copy link

zen85 commented Dec 28, 2022

the atmosphere is not rendering and the three-globe library throws this in the console:

"three-globe:2 Uncaught TypeError: Cannot read properties of undefined (reading 'position')
    at ir (three-globe:2:58765)
    at A.atmosphereObj.backside (three-globe:2:61042)
    at Function.update (three-globe:2:61110)
    at three-globe:2:7703
    at l (three-globe:2:5265)"

if i include my libraries like that (as you can see i also switched the tbcontrols with the OrbitControls):

<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.js"></script>
<script src="//unpkg.com/three-globe"></script>
			const orbitControls = new THREE.OrbitControls(camera, renderer.domElement);
			orbitControls.enableZoom = true;
			orbitControls.maxDistance = 400;
			orbitControls.minDistance = 101;
			orbitControls.maxPolarAngle = Math.PI / 2;

it works but just has problems with the atmosphere apparently.

@vasturiano
Copy link
Owner

@zen85 thanks for reaching out.

This is essentially because on v0.125 of ThreeJS there was a breaking API change introduced. Plain geometries were deprecated, and what was previously called buffer geometries started being called just geometries. You can find the details of that release here:
https://github.com/mrdoob/three.js/releases/tag/r125

The result is that the code in this module expects a sphere buffer geometry to create the glow, which in the new spec is simply called SphereGeometry. While in versions prior to 125, SphereGeometry was not a buffer geometry that's why the code chokes.

So, unfortunately there's not really much choice other the upgrading the three version to at least 125 if you want it to be compatible with the latest version of this module.

I am also updating the min version in peerDependencies to reflect this.

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