haosulab / SAPIEN

SAPIEN Embodied AI Platform
https://sapien.ucsd.edu/
MIT License
430 stars 41 forks source link

How to not display the xyz axis of the world frame in the rendered picture. #130

Open hermosaaurora opened 1 year ago

hermosaaurora commented 1 year ago

System:

Describe the bug Why are there always x/y/z axis of the world frame in the rendered picture? How can I exclude them or resize their thickness in my rendered pictures?

To Reproduce Steps to reproduce the behavior (use pastebin for code):

def get_rgb(self):
        self.camera.take_picture()
        rgba = self.camera.get_float_texture('Color')
        rgba = (rgba * 255).clip(0, 255).astype(np.float32) / 255
        white = np.ones((rgba.shape[0], rgba.shape[1], 3), dtype=np.float32)
        mask = np.tile(rgba[:, :, 3:4], [1, 1, 3])
        rgb = rgba[:, :, :3] * mask + white * (1 - mask)
        return rgb

Expected behavior I expect the axis can be excluded from the pictures

hermosaaurora commented 1 year ago

I know where the bug is. To show the gui, I follow the example code in your documentation and set the Viewer. I add the two lines of code in my project:

self.viewer = Viewer(self.renderer)
self.viewer.set_scene(scene=self.scene)

if I comment out the codes, then the rendered images will be with no axes. So I take a skim at the set_scene's implementation:

https://github.com/haosulab/SAPIEN/blob/ab1d9a9fa1428484a918e61185ae9df2beb7cb30/python/py_package/utils/viewer.py#L1977-L1983

as you can see in line 1982, the argument of self.toggle_axes is always True. I think there can be an option for the user to decide whether they want the axes to be shown.