Setting the camera matrix manually in ThreeJS

后端 未结 1 1778
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 11:48

I\'m trying to manually set the matrix of a camera in a simple three.js scene. I\'ve tried calling the matrix.set method in combination with matrixAutoUpdate = false, but wh

相关标签:
1条回答
  • 2021-01-13 11:58

    After setting the camera matrix, you need to call

    camera.updateMatrixWorld( true );
    

    What you are doing is not advisable.

    three.js was not designed to be used this way. It is best not to mess with an object matrix directly -- unless you really know what you are doing, and understand the inner-workings of the library.

    Instead just set the camera's quaternion (or rotation), position, and scale, and let the library update the matrix.

    three.js r.60

    0 讨论(0)
提交回复
热议问题