I have the following matrix (last one logged into console, the offset applied is set correctly on the matrices):
[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2.28859130859375, 0, 1]
as a result of applying this transformation:
const height = assembler.object.getSize().y * 0.001;
let target = assembler.object;
assembler.object.clear();
let parts = new InstancedMesh(target.geometry, target.material, numberOfParts);
for (let i = 0; i < numberOfParts; i++) {
let mat4 = new Matrix4();
parts.getMatrixAt(i, mat4);
mat4.makeTranslation(0, height * i, 0);
parts.setMatrixAt(i, mat4);
console.log(mat4)
}
parts.instanceMatrix.needsUpdate = true;
assembler.object.add(parts);
assembler.object.scale.setScalar(0.001);
assembler.object.rotateY(-Math.PI / 2);
assembler.object.position.set(-assembler.sideParams.get('WIDTH') / 2, 0, 0)
}
But when I look in the scene the transformations are not applied to the objects (at least not visibly).
The only time anything is added to the assembler
is in this code. I am not sure what is going wrong here, the matrix appears to be correct isn’t it?