gltfjsx icon indicating copy to clipboard operation
gltfjsx copied to clipboard

Method toVector3 was removed from three.js, still used in gltfjsx

Open lukashaertel opened this issue 1 year ago • 2 comments

In the code, gltfjsx uses the toVector3 method in this location:

https://github.com/pmndrs/gltfjsx/blob/7d18a9e65287a3cd0d237bbd3f6bfffc21a09d24/src/utils/parser.js#L170

The definition used is here:

https://github.com/mrdoob/three.js/blob/95ef309c79158aa506f3f7ddeab769e7c4908187/src/math/Euler.js#L294

In the current release of three.js, this method is no longer present, see PR:

https://github.com/mrdoob/three.js/pull/23494

This breaks compatibility when trying to use the parser stand-alone with a newer version of three.js installed. Since this is the only location I can find, it is probably very easy to fix by creating a function to compute the Euler's length or by using the setFromEuler method on the vector:

https://threejs.org/docs/index.html#api/en/math/Vector3.setFromEuler

lukashaertel avatar Jan 24 '23 10:01 lukashaertel

would you make this a quick pr to fix it? i wasn't aware that this was changed.

drcmda avatar Jan 24 '23 17:01 drcmda

There was a bit that needed changing, see #181

lukashaertel avatar Jan 25 '23 08:01 lukashaertel