Is anybody aware of issues with computeWorldMatrix(true)
? I set a plane’s absolutePosition in a loop (and it can’t run in the render loop, since there are a lot operations taking place) and it seems that computeWorldMatrix (true) doesn’t really reflect the changes to the position. This is evident when projecting. Is there anything other than computeWorldMatri I need to use for outside of render loop?
I saw several links online throughout the years mentioning issues with this.
Before projecting
label._CoT.computeWorldMatrix(true);
label.labelPlane.computeWorldMatrix(true);
mesh.computeWorldMatrix(true);
camera.computeWorldMatrix(true);
I make these call to make sure the world matrix is recomputed.
let screenProjectedCorners = cornersWorld.map(cornerWorld => {
return BABYLON.Vector3.Project(
cornerWorld,
BABYLON.Matrix.IdentityReadOnly,
scene.getTransformMatrix(),
camera.viewport.toGlobal(
engine.getRenderWidth(),
engine.getRenderHeight(),
)
);
});