26 lines
702 B
Python
26 lines
702 B
Python
"""Spawn a viewer and log some data."""
|
|
|
|
import numpy as np
|
|
|
|
import rerun as rr
|
|
|
|
# Initialize the SDK, give our recording a unique name, and spawn a viewer
|
|
rr.init("rerun_example_quick_start_spawn", spawn=True)
|
|
|
|
# Create some data
|
|
SIZE = 10
|
|
|
|
pos_grid = np.meshgrid(*[np.linspace(-10, 10, SIZE)] * 3)
|
|
positions = np.vstack([d.reshape(-1) for d in pos_grid]).T
|
|
|
|
col_grid = np.meshgrid(*[np.linspace(0, 255, SIZE)] * 3)
|
|
colors = np.vstack([c.reshape(-1) for c in col_grid]).astype(np.uint8).T
|
|
|
|
# Log the data
|
|
rr.log(
|
|
# name under which this entity is logged (known as "entity path")
|
|
"my_points",
|
|
# log data as a 3D point cloud archetype
|
|
rr.Points3D(positions, colors=colors, radii=0.5),
|
|
)
|