Reputation: 1
I want to position the html components like mesh even if they are enlarged or reduced. But this is what happens when you zoom in or out
this is my code
<Canvas style={{ width: "100%", height: "100%" }} shadows>
<axesHelper args={[100]} />
<Camera />
<group dispose={null}>
<mesh position={[0, 0, 0]} geometry={new THREE.BoxGeometry()}>
<Html position={[0, 0.05, -0.09]} transform>
<div
style={{
padding: "10px",
background: "white",
}}
>
<h1>Hello World</h1>
<p>This is a simple HTML element inside a 3D scene.</p>
</div>
</Html>
</mesh>
</group>
...
I'd appreciate it if you could give me a way or link to try it.
Upvotes: 0
Views: 13