Tell your agent

If you are a person working with Claude, ChatGPT, Cursor or any other coding agent, paste something like this:

"Show this data in 3D with ImmersivePoints. Follow https://immersivepoints.com/for-ai-agents.html and give me the viewer link."

Works for point clouds, LiDAR scans, 3D embeddings, molecules, star catalogs, tracking data: anything with three coordinates. A plain-text version of this page for language models is at /llms.txt.

The recipe

1Get the helper. It is one file that needs only numpy.

curl -O https://immersivepoints.com/examples/viewer_link.py

2Fit the data to the view, pick colors, and build the link.

import numpy as np
from viewer_link import fit_to_view, hue_from_values, viewer_link

xyz = fit_to_view(my_xyz)            # (N, 3): centered, about 8 units across, Z up
hue = hue_from_values(my_values)     # (N,): red = low ... cyan = high
link = viewer_link(np.column_stack([xyz, hue]))
print(link)

3Give the person the link. It opens in any modern browser; in a Quest or PC VR headset they press Enter VR.

The helper also has:

  • y_up_to_z_up(xyz) for data from Y-up tools (three.js, glTF, OBJ, game engines). LiDAR, ROS, GIS and CAD data are already Z up.
  • hue_from_labels(labels) for class labels or clusters.
  • subsample(points, max_points=500_000) to keep headsets smooth.
  • viewer_link(url=...) for a hosted file instead of inline data, plus point_size, auto_rotate, show_axes, bboxes_url and lines_url.

Run python viewer_link.py without arguments to get a demo link and check that everything works.

The link format

No Python, or want to know what the helper does? A viewer link is built in four steps.

  1. Rows of float32. One row per point: x, y, z, hue (type XYZI) or x, y, z, r, g, b (type XYZRGB). Hue and RGB values are 0 to 1.
  2. Big-endian bytes, then base64. The viewer reads big-endian float32 (numpy astype(">f4")). Little-endian bytes still load, but every number comes out as garbage, so this is the most common mistake.
  3. A JSON config, base64 encoded: {"points": [{"source": "base64", "base64": "<data>", "type": "XYZI"}]}
  4. The URL: https://immersivepoints.com/oculus.html#jsonb64=<URL-encoded config>

Use #, not ?. Everything after # stays in the browser: it is never sent to a web server, so there is no server-side length limit and the data stays private. The older ?jsonb64= form still works for short links.

The same thing in JavaScript

// xyzi: a flat array, 4 numbers per point (x, y, z, hue 0-1)
function viewerLink(xyzi) {
  const bytes = new DataView(new ArrayBuffer(xyzi.length * 4));
  xyzi.forEach((v, i) => bytes.setFloat32(i * 4, v, false));   // false = big-endian
  let bin = '';
  new Uint8Array(bytes.buffer).forEach(b => bin += String.fromCharCode(b));
  const config = {points: [{source: 'base64', base64: btoa(bin), type: 'XYZI'}]};
  return 'https://immersivepoints.com/oculus.html#jsonb64=' +
         encodeURIComponent(btoa(JSON.stringify(config)));
}

A hosted file instead of inline data

Write the same big-endian bytes to a file (.xyzi or .xyzrgb), host it anywhere that sends CORS headers, and point the config at it: {"points": [{"source": "url", "url": "https://.../scan.xyzrgb", "type": "XYZRGB"}]}. Compressed Cloudini files (.cldn) work too, with "type": "CLOUDINI".

For a single file with no other options there is a shorter form: https://immersivepoints.com/oculus.html?url=https://.../scan.xyzrgb (add &mode=xyzi, xyzrgb or cloudini if the extension does not show the format).

Make it look good

The viewer has few knobs, so a good result comes from preparing the data. These rules follow from how the viewer renders: a blue background (#2d4aa8), a camera 20 units from the origin with a narrow field of view, and square points 0.02 units wide by default, drawn at their true size.

1. X forward, Y left, Z up

The viewer uses the ROS convention, like LiDAR, ROS, GIS and most CAD data, so those need no conversion. Data from Y-up tools (three.js, glTF, OBJ, game engines) shows up lying on its side: rotate it with (x, y, z) → (−z, −x, y), which is what y_up_to_z_up does. Never just swap two columns: that mirrors the scene.

Not sure? Add showAxes=true to the link: red is X (forward), green is Y (left), blue is Z (up).

2. Center it and scale it to about 8 units

The desktop camera sits 20 units from the origin and sees about 9.5 units from top to bottom. Data in kilometres is a speck; data in millimetres fills the screen. Center on the origin and scale the largest side to roughly 8.

Scale on the 1st to 99th percentile, not on the min and max, so a few stray points do not shrink everything else.

3. For walk-through scenes, use metres

In VR the person starts at the origin, standing on z = 0, looking along +X. For streets, rooms or buildings, keep real-world metres, put the ground at z = 0 (fit_to_view(..., floor=True) does this after scaling) and put the most interesting spot near the origin.

Rule 2 gives the best first impression on a laptop; rule 3 gives the best one in a headset. Choose based on who will open the link.

4. Match point size to density

Points should almost touch their neighbours. The size is a point's diameter in scene units, drawn at true size. After fitting to 8 units:

  • under 20k points: point_size 0.03 to 0.05
  • 20k to 300k points: the default 0.02
  • dense scans above 300k: 0.01 to 0.015

Too small looks like faint dust; too large turns into blobs. Set it with "pointSize" in the config or pointSize= in the link; viewers can also scale it with the on-screen buttons, the + and − keys, or the grips in VR.

5. Pick colors that show up on blue

XYZI hue runs red (0) → yellow (0.17) → green (0.33) → cyan (0.5) → blue (0.67) → magenta (0.83). Blues and violets (about 0.58 to 0.78) blend into the background.

For a continuous value use hue 0 to 0.55 (hue_from_values). For categories use hue_from_labels, which skips the blues. With no meaningful value, color by height: hue_from_values(xyz[:, 1]).

6. RGB: 0 to 1, and not too dark

XYZRGB colors are floats from 0 to 1, so divide 8-bit colors by 255. Very dark points vanish against the background; lift them with rgb = 0.15 + 0.85 * rgb.

Camera-colored scans (photogrammetry, colored LiDAR) usually look best as XYZRGB; everything else usually reads better as XYZI.

7. Keep the point count sensible

Stay under about 500k points for standalone headsets such as the Quest. More points rarely look better than a well-chosen point size. Use subsample(), or average points per voxel for scans.

For larger data, host a file and compress it with Cloudini.

8. Show it off on desktop

Add autoRotate=true to the link (viewer_link(..., auto_rotate=True)) so the shape reads immediately in a browser. It does nothing in VR.

Desktop controls: drag to rotate, scroll to zoom, right-drag or arrow keys to pan.

Inline or hosted?

Inline ("source": "base64")Hosted file ("source": "url")
Best forUp to about 30k pointsAnything bigger, or a link that must stay short
Link lengthAbout 28 characters per XYZI point, 43 per XYZRGB pointA few hundred characters
NeedsNothingA host that sends CORS headers
PrivacyThe data lives in the link onlyAnyone with the file URL can download it

Hosts that work: a public GitHub repository (https://raw.githubusercontent.com/<user>/<repo>/<branch>/scan.xyzrgb), GitHub Pages, or an S3 or Google Cloud Storage bucket with CORS enabled. ImmersivePoints itself does not host files.

Long inline links can be cut off by chat apps, email and terminals. If you show the link in a chat, use a markdown link ([Open in VR](https://...)), or save it to a small HTML file with a button, or host the data instead.

Check before you share

  • The array is 2-D with 4 (XYZI) or 6 (XYZRGB) columns, and contains no NaN or inf values.
  • The bytes are big-endian float32: astype(">f4").
  • Hue and RGB values are between 0 and 1.
  • The data is Z-up (X forward, Y left), centered and scaled (or in metres with the ground at z = 0).
  • The link uses #jsonb64= and the config was URL-encoded.

If you can run a browser (for example Playwright), open the link and take a screenshot. The browser console prints Loaded num points N on success. Problems show a red panel with a title such as Data Parsing Error, File Not Found or Network Error, plus details. Headless Chromium needs WebGL, for example the flags --use-gl=swiftshader --enable-unsafe-swiftshader.

Recipes by data type

Each recipe links to a complete notebook with real data.

🛰️ LiDAR and scans (LAS, LAZ, PLY, PCD)

Read x, y, z with laspy or open3d and keep them as they are (already Z up), keep metres with floor=True for walk-throughs, color by height or intensity, subsample to 500k.

LiDAR notebook →

🧠 Embeddings and clusters

Reduce to 3 dimensions with UMAP, t-SNE or PCA, fit_to_view, color with hue_from_labels(cluster_ids), and use a larger point size because embeddings are sparse.

Embeddings notebook →

🧬 Molecules

Atom coordinates from a PDB file, colored by element with hue_from_labels(elements). Proteins are small, so scale up and use point size 0.05 or more.

Molecules notebook →

🌌 Stars and galaxies

Convert right ascension, declination and distance to Cartesian coordinates, compress distance with a log so near and far stars both fit, and color by star temperature.

Astronomy notebook →

⚽ Tracking and time series

Use x and y as the ground plane, time as height, and color by team or player. This shows trajectories as trails you can walk through.

Tracking notebook →

📄 CSV and DataFrames

Pick three numeric columns for position and one for color: df[["x", "y", "z"]].to_numpy(). Drop rows with missing values first.

CSV notebook →

Reference

URL parameters

Put them after # (recommended) or ?, joined with &.

ParameterValue
jsonb64Base64 of the JSON config below, URL-encoded. Standard and URL-safe base64 both work.
urlShortcut for a single hosted file: oculus.html?url=https://example.com/scan.xyzrgb. Add mode=xyzi, xyzrgb or cloudini if the file extension does not say. Use it after ?, not #. URLs with their own query string, such as presigned links, can be pasted unencoded if url= comes last. name is an older alias.
base64Shortcut for inline XYZI data without a config.
pointSizePoint diameter in scene units, drawn at true size. Default 0.02. Replaces a top-level "pointSize" in the config, not per-cloud ones.
frames, fpsPlay a sequence: url=https://host/scan_{i:04}.xyzi&frames=0-199&fps=10 loads one file per frame. See Sequences for per-frame boxes and lines.
configURL of a hosted JSON config (same format as jsonb64), for scenes too big for a link.
axesthreejs shows files made for the viewer's old Y-up convention as stored. Leave it out for new data.
autoRotatetrue rotates the scene on desktop. Leave the parameter out to turn it off.
showAxestrue draws X (red, forward), Y (green, left) and Z (blue, up) axes 5 units long. Leave the parameter out to turn it off.

JSON config

{
  "points": [                                   // one or more point clouds
    {"source": "base64", "base64": "...", "type": "XYZI", "pointSize": 0.02},
    {"source": "url", "url": "https://.../scan.xyzrgb", "type": "XYZRGB"}
  ],
  "bboxes":  [{"source": "url", "url": "https://.../boxes.bbox"}],   // first entry only
  "lines":   [{"source": "url", "url": "https://.../edges.lines"}],  // first entry only
  "objects": [{"source": "url", "url": "https://.../car.glb",
               "position": [0, 0, 0], "rotation": [0, 0, 0], "scale": [1, 1, 1]}]
}

The comments are for reading only: JSON itself does not allow them.

Binary layouts

All files are rows of big-endian float32 values, with no header.

TypeValues per rowColumns
XYZI4x, y, z, hue (0 to 1)
XYZRGB6x, y, z, red, green, blue (0 to 1)
Boxes (bboxes)13center x, y, z; size x, y, z; rotation around x, y, z (radians; a heading is the rotation around z); red, green, blue, opacity (0 to 1)
Lines (lines)6start x, y, z; end x, y, z
CLOUDINI-A Cloudini file; detected from its header

Objects (objects) are glTF or GLB models with an optional position, rotation and scale in the same axes as the points. Models are made Y up facing +Z, so the viewer stands them up along Z facing +X. They are drawn half transparent so the points stay visible.

VR controls

Hold one trigger to fly forward in the direction you look and the other to fly backward. One thumbstick moves you around, the other turns you. Hold the right grip to make points bigger and the left grip to make them smaller. In a sequence, A or X plays and pauses, B steps forward and Y steps back.