Closed Serotoninene closed 1 year ago
In order to have a better understanding of the problem, I made a more simple example using a very basic threejs scene and simple barbajs transitions : https://codesandbox.io/p/github/Serotoninene/webglCarousel/draft/pedantic-bohr?file=/src/script.js:56,44&workspaceId=920cf671-f4e1-42cb-92f2-5c4639d15ed2
Here is what I've found :
the "leave" function of barbajs must return something but the "enter" must not. the cleanup must be thorough, you should remove the scene and dispose the render but also remove all eventsListeners; I had to reset the scene, render and reselect the dom element I wanted to use as canvasContainer and of course recreate the meshes and reset the requestAnimationFrame :) I also learned that making the most simplified version is a great way to find the answer !
Hope this will help, Cheers
I can't reinitialize my threejs scene and meshes when i'm heading back to the home from my inside page. Does any one can see where the problem is ? I've been console logging the meshes, they appear in the console but not on the screen. Why ? Does anyone with more experience on mixing barba and threejs know ?
I've made a codeSandbox for more insight on the code : https://codesandbox.io/p/github/Serotoninene/webglCarousel/draft/pedantic-bohr?file=/src/inside.html:44,48&workspaceId=920cf671-f4e1-42cb-92f2-5c4639d15ed2
here is my barba function
here is my addObjects function :