Question

I just checked out a running project on another laptop. upon installing everything with npm and bower, when I try to run it on localhost I get the following error:

Uncaught TypeError: Cannot redefine property: rotation 

at (line 7542 in non minified three.js r67):

THREE.Object3D = function () {

this.id = THREE.Object3DIdCount ++;
this.uuid = THREE.Math.generateUUID();

this.name = '';

this.parent = undefined;
this.children = [];

this.up = new THREE.Vector3( 0, 1, 0 );

this.position = new THREE.Vector3();

var scope = this;

Object.defineProperties( this, {
    rotation: {
        enumerable: true,
        value: new THREE.Euler().onChange( function () {
            scope.quaternion.setFromEuler( scope.rotation, false );
        } )
    }, [...]

so it's something going wrong in three.js and I have no idea why, but it obviously breaks the entire app. Has anyone experienced this yet?

Was it helpful?

Solution

That's intentional.

These patterns don't work anymore:

object.rotation = object2.rotation
object.rotation = new THREE.Euler( 1, 0, 0 );

Do this instead:

object.rotation.copy( object2.rotation );
object.rotation.set( 1, 0, 0 );

The next version will have better error messages for this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top