can i have two instancedMesh with 50 object on each with same location and size?
Is it correct to create two Instancedmesh with just one “for” loop?
const mesh1 = instancedmesh(geometry,material,50)
const mesh2 = instancedmesh(geometry,material,50)
for (var i = 1; i < 50; ++i) {
mesh1.setMatrixAt(i,…
mesh2.setMatrixAt(i,…
I want these objects to be placed in exactly the same place, given that the location of the first object is random
My problem is that I want to use the x and z position of mesh1 for mesh2 but not works
mesh1.setMatrixAt(
i,
new THREE.Matrix4()
.makeTranslation(2, 0 ,1)
.multiply(new THREE.Matrix4().makeScale(0, 0.1, 0))
);
//-----------------
mesh2.setMatrixAt(
i,
new THREE.Matrix4()
.makeTranslation(mesh1.position.x, 0, mesh1.position.z)
.multiply(new THREE.Matrix4().makeScale(0, 0.05, 0))
);
//------
mesh1.position.x and z dont work in mesh2 traslation