'How to do back-face culling in an open3D scene with OffscreenRenderer?
I have a mesh and a material that I render with the open3D OffscreenRenderer. The object is one side of a sphere that I have reconstructed. I want the triangles of the mesh to not be rendered, when the camera is looking from the "wrong" direction. This is also known as "back-face culling". I can't figure this out.
Here's the code I'm currently using to get the render:
import open3d as o3d
import numpy as np
def get_render(WIDTH_RENDER, HEIGHT_RENDER, mesh, material):
render = o3d.visualization.rendering.OffscreenRenderer(WIDTH_RENDER, HEIGHT_RENDER)
render.scene.set_background(np.float32((0,0,0,0)))
render.scene.set_lighting(render.scene.LightingProfile.NO_SHADOWS, (0, 0, 0))
K = calculate_K()
render.scene.add_geometry("terrain",mesh,material)
render.scene.camera.set_projection(K,0.1,10000.,WIDTH_RENDER,HEIGHT_RENDER)
return render
I know that there is a parameter in the open3D visualization class method draw_geometries called "mesh_show_back_face" that does exactly what I need, but I have not been successful in implementing it to the OffscreenRenderer.
I'm not using the o3d.visualization.draw_geometries(), because it is blocking and I don't have precise control over the cameras intrinsic and extrinsic parameters.
Any opinions and recommendations would be very welcome.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
