Three.js: Matrix added to instance mesh on subsequent frame doesn't work

Created on 25 Mar 2020  路  4Comments  路  Source: mrdoob/three.js

I found that if I try to add another instance to an InstancedMesh on a frame(?) after the one on which the InstancedMesh is created, the second instance it doesn't appear.

http://jsfiddle.net/vm4zpdx1/2/

Help (please use the forum)

All 4 comments

Updated fiddle: http://jsfiddle.net/d4oq5ahx/

If you modify instanced data, you also have to set InstancedMesh.instanceMatrix.needsUpdate to true.

Please use the forum or stackoverflow if you need more help.

Ah OK. The documentation says this..

.instanceMatrix : BufferAttribute
Represents the local transformation of all instances. For internal use only.

Yes, the documentation should be better in this case. How about:

Represents the local transformation of all instances. You have to set its needsUpdate flag to true if you modify instanced data via [page:.setMatrixAt()].

Let's give this a try.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boyravikumar picture boyravikumar  路  3Comments

jlaquinte picture jlaquinte  路  3Comments

fuzihaofzh picture fuzihaofzh  路  3Comments

ghost picture ghost  路  3Comments

zsitro picture zsitro  路  3Comments