I have a and array of cameras streaming videos.
i need half of them to use useRightHandedSystem
, and the other half to use useLeftHandedSystem
.
But when I do Scene.useRightHandedSystem = false
, it changes the whole thing.
Can i make this conditionally, based on camera name?
// Makes 6 small canvas, and inserts camera with streaming for each canvas
multipleCanvasCreation(scene) {
for (const cameraInformation of this.cameraInformations) {
const canvas = document.getElementById(`${cameraInformationrmation.name}_myCanvas`);
// Set handedness for the camera
if (
cameraInformation.name === "cam1" ||
cameraInformation.name === "cam3" ||
cameraInformation.name === "cam5"
) {
const camera = new BABYLON.ArcRotateCamera(
`${cameraInformation.name}_eachcamera`,
0,
0,
0,
cameraInformation._p.add(cameraInformation._dir.scale(this.deltaTarget)),
scene
);
camera.fov = (this.lastfov * Math.PI) / 180;
camera.maxZ = this.far;
camera.minZ = this.near;
this.engine.registerView(canvas, camera);
cameraInformation._eachCamera = camera;
} else if (
cameraInformation.name === "cam2" ||
cameraInformation.name === "cam4" ||
cameraInformation.name === "cam6"
) {
const camera = new BABYLON.ArcRotateCamera(
`${cameraInformation.name}_eachcamera`,
0,
0,
1,
cameraInformation._p.add(cameraInformation._dir.scale(this.deltaTarget)),
scene
);
camera.fov = (this.lastfov * Math.PI) / 180;
camera.maxZ = this.far;
camera.minZ = this.near;
camera.setPosition(cameraInformation._p.clone());
this.engine.registerView(canvas, camera);
cameraInformation._eachCamera = camera;
}
}
}
The above is currently working fine, but i just want to change the handedSystem
based on camera name, not globally.
useRightHandedSystem
is set to false in initialization.