#Error viewing shapes on mobile
31 messages · Page 1 of 1 (latest)
Are these images or threejs renderings ?
They are IcosahedronGeometry figures of three js each with a decal
are you creating a separate renderer to create each one?
Yes
You shouldn’t do that
The first few images get broken most likely because you create more and more WebGL context for the later images
And browser just disposes the earlier renderer contexts (causing a context loss)
Consider using just a single renderer to render all images - you can just switch to which canvas the renderer should output the frame
But if I do a single render, the orbit control would be bad
Because all the figures would move by moving one
Uhhhhhh that's possible? I tried to do that, but I got an error
I'll try to do it again
Thanks for the help, I'll tell you how it went
I have a question
I have 12 figures, each figure is in a different div, when creating a single render, all the figures will be in jn only div right?
Just read the code, I think I saw what my mistake was, thank you very much
this is r3f? judging by the react icon ...
in that case use drei/view and your problems are solved
you can have thousands of views now, and it's driven by a single canvas. it takes care of orbitcnotrols and each view is truly isolated, you can have environments in there, controls, everything
and just in case it's not, you probably should use it because no such thing as view exists in vanilla, it's all half baked and you'll waste weeks on a clean implementation. there's a simple component for decals as well https://codesandbox.io/s/iridescent-decals-qvb1vk?file=/src/App.js
Iridescent decals by drcmda using @react-three/drei, @react-three/fiber, @types/three, leva, react, react-dom, react-scripts, three
I already fixed that error based on this example
https://threejs.org/examples/webgl_multiple_elements.html
But I have a problem , I can't make the elements on the canvas look good