Once again, why donโt you just use one scene, divide it into 2 parts, set the FOV (field of view) of the camera so that you can see only one part of the scene at a time, and then just move the position of your camera ... Doesnโt it seem is it more efficient?
If there is no particular reason for using 2 scenes, you can always implement your code with only one scene. Therefore, try the method described above or explain the reasons for using two scenes.
Edit: You can also use two THREE.Object3D containers to represent your 2 scenes, where you can store all your specific scene objects, and then just show / hide one of the containers at a time. Than you can manage the contents of the container using yourContainer.children[n] .
This is usually what you want to do:
var scene1Container = new THREE.Object3D(); var scene2Container = new THREE.Object3D(); scene1Container.add(firstObjectFromScene1);
now you can simply show / hide one of the containers at a time using scene1Container.visible = true/false; (and manage scene1Container.traverse to apply the visibility change to all the children of your object).
source share