Hole in floor #245
-
Hello everyone! I want to display a hole in the ground with AR, but have no idea on how to do that. I have a simple pool shaped mesh that I can display in ar, but that's as far as I have come. Any help? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Do you have a concept of how it would look in a simple 3d scene? |
Beta Was this translation helpful? Give feedback.
-
I would use drei helpers "Mask" or "MeshPortalMaterial" |
Beta Was this translation helpful? Give feedback.
-
You want to render the hole using as a cylinder that only renders the inside <mesh>
<meshPhongMaterial side={BackSide} />
<cylinderGeometry/>
</mesh> and place this cylinder with the top side at This can be achieved by rendering a plane that has a hole cut into at the position and size of the cylinder. You can build this plane with blender for instance. Alternatively, use a stencil buffer to cut out the whole into the plane. Once you have this plane, import it as a gltf for instance and retrieve the geometry from the gltf. Using the <mesh geometry={loadedPlaneGeometry}>
<meshBasicMatererial colorWrite={false} renderOrder={-100} />
</mesh> I hope it helps :) |
Beta Was this translation helpful? Give feedback.
You want to render the hole using as a cylinder that only renders the inside
and place this cylinder with the top side at
0,0,0
.Now, in are the hole is already visible but you can see it from the side, so you want to make sure its only rendered when looking into the whole.
This can be achieved by rendering a plane that has a hole cut into at the position and size of the cylinder. You can build this plane with blender for instance. Alternatively, use a stencil buffer to cut out the whole into the plane.
Once you have this plane, import it as a gltf for instance and retrieve the geometry from the gltf. Using the
l…