Changing scenes with arrowkeys

Let’s just say I made a basic scene to display a 3d model, but I have an idea in making it like a parallax, so I can see different models, one at s time in the same webpage/landing page

I think this can be implemented by changing the whole scene by pressing one of the arrowkeys or by changing just the model, any idea if this has been implemented or where can I start?

Thanks in advance for any guidance

Hi, to achieve this, you will have to clear the scene and load another object to that scene. This can be achieved by event listening in Js(also you can hide the button through css). This approach will also help in saving some resources. Just keep track of you RAM usage while loading different objects into same scene as I had some issues with that which I had found at a very later stage. Hope this helps.

1 Like

Consider react-three-fiber if you’re familiar with react - it will make this scene traversal and memory management quite a bit less painful compared to vanilla three (it’s still doable, but you have to remember to dispose things that are no longer necessary / on other scenes.)

1 Like