Skip to content

Commit 9430fe3

Browse files
committed
add pose transform section
1 parent e46e45b commit 9430fe3

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

docs/content/concepts/transforms.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ rr.log("arm",
159159
rr.log("gripper", rr.Points3D([0, 0, 0]), rr.CoordinateFrame("arm_frame"))
160160
```
161161

162+
TODO: show a picture of a tree.
163+
162164
## Pinhole projections
163165

164166
In Rerun, pinhole cameras are also treated as spatial relationships that define projections from 3D spaces to 2D subspaces.
@@ -173,6 +175,9 @@ With the right setup, pinholes allow a bunch of powerful visualizations:
173175
* 3D in 2D: if the pinhole is at the origin of the view, 3D objects can be projected through pinhole camera into the view.
174176
* Both the [nuscenes](https://rerun.io/examples/robotics/nuscenes_dataset) and [arkit](https://rerun.io/examples/spatial-computing/arkit_scenes) examples make use of this
175177

178+
If a transform frame relationship has both a pinhole projection & regular transforms (in this context often regarded as the camera extrinsics)
179+
the regular transform is applied first.
180+
176181
### Example: 3D scene with 2D projections
177182

178183
Here's how to set up a 3D scene with pinhole cameras that create 2D projections:
@@ -206,14 +211,47 @@ WARNING: unlike in 3D views where `rr.ViewCoordinates` only impacts how the rend
206211

207212
For 2D spaces and other entities, view coordinates currently have currently no effect ([#1387](https://github.com/rerun-io/rerun/issues/1387)).
208213

209-
## Poses & instancing
214+
## Pose transforms
215+
216+
[`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d) defines geometric poses relative to an entity's transform frame.
217+
Unlike with [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d), poses do not propagate through the transform hierarchy
218+
and can store an arbitrary amount of transforms on the same entity.
219+
220+
An entity that has both [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)
221+
without `child_frame`/`parent_frame` as well as `InstancePoses3D`,
222+
the [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d) is applied first
223+
(affecting the entity and all its children), then [`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d)
224+
is applied only to that specific entity.
225+
(This is consistent with how entity hierarchy based transforms translate to transform frames.)
226+
227+
### Instancing
228+
229+
Rerun's [`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d) archetype is not only used
230+
to model poses relative to an Entity's frame, but also for repeating (known as "instancing") visualizations on the same entity:
231+
most visualizations will show once for each transform on [`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d)
232+
in the respective place.
210233

211-
TODO: briefly explain poses, how they're relative to their entity's frame, how they can be used for instancing. Use a viewer embed of the instancing example.
234+
snippet: archetypes/mesh3d_instancing
235+
236+
<picture data-inline-viewer="snippets/archetypes/mesh3d_instancing">
237+
<source media="(max-width: 480px)" srcset="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/480w.png">
238+
<source media="(max-width: 768px)" srcset="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/768w.png">
239+
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/1024w.png">
240+
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/1200w.png">
241+
<img src="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/full.png">
242+
</picture>
243+
244+
In this example, the mesh at `"shape"` is instantiated four times with different translations and rotations.
245+
The box at `"shape/box"` is not affected by its parent's instance poses and appears only once.
246+
247+
<!--
212248
213249
## Visualizing transforms
214250
215-
TODO: write about how transforms can be visualized
251+
TODO(andreas, grtlr): write about how transforms can be visualized
216252
217253
## 2D Transforms
218254
219-
TODO: lack of 2d transforms
255+
TODO(#349): lack of 2d transforms
256+
257+
-->

0 commit comments

Comments
 (0)