Open
Description
I am trying to render depth images and therefore modified the "core_offscreen_rendering.py" example as follows:
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
from OCC.Core.Graphic3d import Graphic3d_BT_Depth
offscreen_renderer = Viewer3d(None)
offscreen_renderer.Create()
offscreen_renderer.SetSize(1024, 768)
offscreen_renderer.SetModeShaded()
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
offscreen_renderer.DisplayShape(my_box, update=True)
data = offscreen_renderer.GetImageData(Graphic3d_BT_Depth)
offscreen_renderer.View.Dump('./capture_jpeg.jpeg', Graphic3d_BT_Depth)
The rendered image only contains the value 1 for every pixel. Is this a bug or am I doing something wrong?
Also: The exported image is of another size than the renderer: 1040x807. This happens also when using Graphic3d_BT_RGB.