Replies: 1 comment 2 replies
-
there's nothing r3f specific. you can use DEFAULT_MATRIX_AUTO_UPDATE, same way it's being recommended by the docs. generally all these settings work the same way in fiber as they do in vanilla, without exception. Object3D.DEFAULT_MATRIX_AUTO_UPDATE = false
...
<mesh> // <- this mesh will not update matrices you can also use THREE.Object3D.prototype + onUpdate which allows you to switch of matrices and, one time, update position/rot/scale anyway, see: https://codesandbox.io/s/angry-jasper-6953er?file=/src/App.js:275-299 this though would only work in fiber. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
To maximize performance,
three.js
recommends to setmatrixAutoUpdate
to false for static objects.This can be done in r3f, but it looks like then a
matrix={...}
argument must be provided to 3d objects insteadof
position
,scale
etc.Setting the global
Object3D.DEFAULT_MATRIX_AUTO_UPDATE
tofalse
seems to require some extra considerations which are unclear from the docs.Does r3f support / plan to support operation with the flag set to
false
?If no:
DEFAULT_MATRIX_AUTO_UPDATE
to betrue
.matrixAutoUpdate
is set tofalse
for individual objects.If yes:
r3f
code work in that situation.In both cases, it would be good to have a few phrases about the matrix update, e.g. under the Performance section.
Beta Was this translation helpful? Give feedback.
All reactions