Gazebo | Ignition | Community
Ask Your Question

Set near/far clip distance for the visualization window camera

asked 2016-06-16 15:18:00 -0600

c_rist gravatar image

When viewing an outdoor gazebo world from some distance above, I get strong Z-fighting artifacts between two ground planes located on top of each other at a distance of about 0.5 meters. I suppose this could be fixed with a more suitable near and far clip distance for the visualization camera. Is there a way to set this distances in gazebo? Is it possible to access the camera parameters using a Gazebo-GUI-Plugin?

edit retag flag offensive close merge delete


Hey guys, we have also the problem with z-Fighting. Is there any possibility to modify the near clipping plane??? A solution or even some advice would be great!! Best regards!!

Illuminatur gravatar imageIlluminatur ( 2016-06-26 22:23:03 -0600 )edit

Are there no ideas? Best regards.

Illuminatur gravatar imageIlluminatur ( 2016-07-02 09:38:09 -0600 )edit

@Illuminatur please don't try hijacking the thread, instead open a new question :)

yah130s gravatar imageyah130s ( 2017-05-17 18:22:06 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-07-03 17:15:40 -0600

chapulina gravatar image

It should be possible to do it from a GUI plugin. Just get the user camera:

rendering::UserCameraPtr camera = gazebo::gui::get_active_camera();

And set the new clip distances:

camera->SetClipDist(near, far);

edit flag offensive delete link more


Thanks a lot, this fixes my problem.

c_rist gravatar imagec_rist ( 2016-07-12 11:35:55 -0600 )edit

answered 2021-12-13 17:02:45 -0600

shonigmann gravatar image

For future users that stumble across this issue and would like to avoid writing their own plugin, the NASA IRG GitHub repo has a plugin that solves this problem

edit flag offensive delete link more

Question Tools



Asked: 2016-06-16 15:17:24 -0600

Seen: 1,515 times

Last updated: Dec 13 '21