Skip to content

LineStrips2D displayed 3D in web #8226

@karolmajek

Description

@karolmajek

Bug description

LineStrips2D are displayed with non zero 3rd axis values in Web GUI
Instead of being displayed sticking to the image plane - as in native app

Image+LineStrips2D natively [Reference - this wokrs good!]

rr.init("rerun_example_image", spawn=True)
# rr.serve_web()

image

Image+LineStrips2D in Web GUI [this behavior is unexpected/surprising/just wrong]

rr.init("rerun_example_image", spawn=False)
rr.serve_web()

trajectories are in 3D in front of the image

image
image
image
image
image

To Reproduce
Steps to reproduce the behavior:

import numpy as np
import rerun as rr
import random

img = np.ones((1080, 1920, 3))

rr.init("rerun_example_image", spawn=False)
rr.serve_web()

rr.log("image", rr.Image(img[:, :, ::-1]))


# Parameters
n = 1000  # Number of trajectories
xmin, xmax = 0, img.shape[1]  # X range
ymin, ymax = 0, img.shape[0]  # Y range
step_min, step_max = 0.1, 2.0  # Minimum and maximum step size

# Generate and log trajectories
for i in range(n):
    # Generate random length for the trajectory
    trajectory_length = random.randint(3, 1000)

    # Start the trajectory at a random initial point
    x, y = random.uniform(xmin, xmax), random.uniform(ymin, ymax)
    trajectory = [[x, y]]

    for _ in range(trajectory_length - 1):
        # Generate a small random step
        step_x = random.uniform(-step_max, step_max)
        step_y = random.uniform(-step_max, step_max)

        # Update the current position with constraints
        x = max(xmin, min(xmax, x + step_x))
        y = max(ymin, min(ymax, y + step_y))

        trajectory.append(
            [
                x,
                y,
            ]
        )

    # Log the trajectory to rerun
    rr.log(f"trajectory_{i}", rr.LineStrips2D([trajectory]))

Expected behavior
to get the same as in native - all trajectories placed on image plane

Desktop (please complete the following information):

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble

Rerun version

rerun --version
rerun-cli 0.20.1 (default map_view nasm native_viewer release web_viewer) [rustc 1.79.0 (129f3b996 2024-06-10), LLVM 18.1.7] x86_64-unknown-linux-gnu release-0.20.1 b85fa9f, built 2024-11-21T08:18:32Z
Video features: av1 default ffmpeg nasm serde

Additional context
Python

python -V
Python 3.12.3

Browser:

brave-browser --version
Brave Browser 131.1.73.89 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions