Hey there . If the scene hasn’t been rendered yet, then you’ll need to call scene.updateTransformMatrix() first, otherwise scene.getViewMatrix() and scene.getProjectionMatrix() will return undefined.
scene.updateTransformMatrix();
Alternatively, you can call camera.getProjectionMatrix() and camera.getViewMatrix() directly, then scene.updateTransformMatrix() won’t be needed.