THREE.js: 2xMeshes using the same vector as the position

I just made an update from r67 - r69 in ThreeJS and ends up having problems referring to their position on the same (same) vector.

Before that I worked:

var vector = new THREE.Vector3(50, 50, 50); _Mesh1.position = vector; _Mesh2.position = vector; 

which allowed him to move the other when moving one of the cells.

In r69, the position vector remains the same (aka 0, 0, 0), which means that I have to manually set the X, Y and Z coordinates for each grid whenever I change the other.

Did I miss some changes here? Or what should I do to fix this?

+5
source share
1 answer

Object3D position , rotation , quaternion and scale properties are now immutable.

See the source code file Object3D.js .

You can no longer use the following template:

 object.position = vector; 

Instead, you should use either

 object.position.set( x, y, z ); 

or

 object.position.copy( vector ); 

three.js r.69

+12
source

Source: https://habr.com/ru/post/1206789/


All Articles