google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
7.47k stars 734 forks source link

Camera Rendering Incomplete After Modifying znear and zfar #1699

Open LinShuang22 opened 4 weeks ago

LinShuang22 commented 4 weeks ago

Hi, I'm a student and I'm trying to use MuJoCo for visual simulation and servo control.

My simulation environment is small, so I need to make the camera's observable space very limited. I am restricting the camera's field of view using the znear, zfar, and extent parameters.

    <statistic extent="1"/>
    <visual>
        <global offheight="6000" offwidth="6000"/>
        <map znear="0.07317" zfar="0.08027"/>
    </visual>

In my model, there are two types of cameras: one is horizontal, and the other is tilted. After limiting the field of view, the rendering of the tilted camera becomes incomplete. Only the lower half displays a normal image, while the upper half may render the scene.

When there are no restrictions, the image looks like this: 图片 When the restrictions are applied, the image looks like this. The upper half of the image displays almost nothing, with only a small part of the scene visible. 图片 I increased the zfar value, which alleviated the issue to some extent, but a significant portion of the scene is still not visible. 图片 Additionally, this issue seems to occur only with the tilted camera, and not with the horizontal camera. 图片

Here is a model which explains my question:

minimal XML ```XML ```

I want to know if there are parameters I haven't set correctly or if this is a bug.

Thanks a lot for your help.