Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D image obscures content more than 500m from the camera #8373

Open
jleibs opened this issue Dec 9, 2024 · 0 comments
Open

2D image obscures content more than 500m from the camera #8373

jleibs opened this issue Dec 9, 2024 · 0 comments
Labels
🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself

Comments

@jleibs
Copy link
Member

jleibs commented Dec 9, 2024

The way our projection math works at the moment, all content acts as if it sits in front of a giant image sitting 500m away from the camera.

This value is hard-coded in the way we set up our transforms.

There is a lot of complexity in how we set up our transform chain for pinholes at the moment and it would be nice to simplify that as well.

@jleibs jleibs added 📺 re_viewer affects re_viewer itself 🪳 bug Something isn't working labels Dec 9, 2024
jleibs added a commit that referenced this issue Dec 9, 2024
### What
This adjusts the value to now be in physical scene units. I.e. for most
3d scenes in meters, the clip plane will be 10cm, which is a very
reasonable default.

Additionally, this gives users an escape hatch for scenes where the
default clipping plane causes their data to not be visible.

Test script:
```python
import rerun as rr
import rerun.blueprint as rrb
import numpy as np

rr.init("rerun_example_pinhole_perspective", spawn=True)

img = np.zeros((300, 300, 3), dtype=np.uint8)

cam_proj = [152.34006, 0, 175.5, 0, 152.34006, 175.5, 0, 0, 1]

rr.log(
    "world/cam",
    rr.Pinhole(
        image_from_camera=cam_proj, width=300, height=300, image_plane_distance=0.1
    ),
)

rr.log("world/cam", rr.Image(img))

rr.log(
    "world/points",
    rr.Points3D([(0.0, 0.5, 0.1), (0.1, 0.1, 0.3), (-0.1, -0.1, 0.5)], radii=0.025),
)
rr.log_file_from_path("examples/assets/example.gltf")
rr.log("examples/assets", rr.Transform3D(translation=[0, 0, 0.4], scale=0.05))

rr.send_blueprint(
    rrb.Horizontal(
        rrb.Spatial3DView(),
        rrb.Spatial2DView(
            origin="world/cam",
            contents="/**",
            visual_bounds=rrb.VisualBounds2D(
                near_clip_plane=0.01,
            ),
        ),
    )
)
```

### New issues:
- #8373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

No branches or pull requests

1 participant