Search code examples
three.jsaframe

AFrame - updating an element's matrix


Recently started using Aframe and Three.js and I am trying to update the matrix of an element from my Aframe scene using the following three.js code:

this.el.object3D.matrix.fromArray(someLength16FloatArray)

But it doesn't seem to work even though if I declare a matrix4 and call it say "m", and use the fromArray() as in the code below to update m, it works.

m.fromArray(someLength16FloatArray)

Is there something I am missing?


Solution

  • It works only if the matrixAutoUpdate property of the element's object3D is set to false.

    this.el.object3D.matrixAutoUpdate = false;