I'm having trouble finding a standard method to animate the transition between different scenes in my Three.js project. My current implementation looks like this:
var sceneIndex;
var currentScene;
switch (sceneIndex) {
case 1:
currentScene = scene;
break;
case 2:
currentScene = scene1;
break;
}
When I want to switch scenes:
if (clickEvent) {
sceneIndex = 2
}
The scene is rendered using this code:
renderer.render(currentScene, camera); //One camera is used
Currently, there is an abrupt change from one scene to another which isn't very user-friendly. I would like to implement a simple fade-to-black animation when the currentScene
variable changes. Can you recommend a way to achieve this effect? Thank you.