examples/rust/raw_mesh/README.md
This example demonstrates two ways to log the same GLB scene: converting it to raw Mesh3D data or sending the original file as an Asset3D.
The example uses Mesh3D by default and switches to Asset3D when you pass --asset3d.
Mesh3D and Asset3DUse Asset3D for assets in a supported format such as GLB, glTF, OBJ, or STL when you don't care about the details of the encoded data.
Rerun stores the file and loads its meshes, embedded materials, and transform hierarchy in the viewer.
Prefer self-contained assets such as GLB because referenced files are not included automatically.
Use Mesh3D for generated meshes, unsupported formats, or explicit control over vertex data.
Logging primitives and transforms as separate entities lets you query and update them independently, but requires your application to parse and convert the source data.
Mesh3DBy default, the example parses the GLB file and logs each mesh primitive and transform separately.
let mesh: rerun::Mesh3D = primitive.into();
rec.log(format!("{}/{}", node.name, i), &mesh)?;
Asset3DWith --asset3d, the scene file is stored in the recording as a single Asset3D.
rec.log(
"world/asset",
&rerun::Asset3D::from_file_path(scene_path)?,
)?;
Run the raw Mesh3D conversion:
cargo run -p raw_mesh
Pass --asset3d to log the selected scene as a prepacked asset:
cargo run -p raw_mesh -- --asset3d
The flag works with both --scene and --scene-path.
Run cargo run -p raw_mesh -- --help for more options.