Closed etienne-85 closed 1 year ago
Nevermind think I found my answer in css3d_sandbox example where both CSS3D object, and regular 3d Mesh are created from DOM element and displayed separately. This does pretty much I was looking for, just I thought maybe there would be a way to do it directly from R3F tags. Closing unless someone has better suggestion
If I understand your question, I think there are a couple of possible options depending on what you want to do:
Thanks for sharing those links. At first glance, seems all are relevant
Will have to further look to decide which one is the most convenient, meanwhile I started coding something with threejs vanilla. If you wonder, I'm looking to generate building structure out of simple html divs, more out of curiosity than real use yet.
I'm looking to generate building structure out of simple html divs
I'm guessing that the scroll rig is probably closest to what you want for that case.
What I'm looking to achieve is render HTML elements as 3D objects using their DOM properties (like width, height,...)
This topic might have been already discussed, but what I found so far was about rendering HTML over 3D objects, and not generating 3D objects from HTML DOM elements.
To illustrate with simple example: for an HTML DIV which renders as a rectangular 2D shape, that would show a corresponding 3D box object with same width, height as DOM object plus and addtional depth
My aim is to benefit from CSS properties (like margin, padding, ...) to customize a shape, and then showing it in 3D.
I know there are probably several ways to do it, but I wanted to make sure I wasn't missing anything obvious before starting coding.
Any suggestions?