|
| Transform3D (const components::Translation3D &translation_, const datatypes::Vec3D(&columns)[3], bool from_parent=false) |
| Creates a new 3D transform from translation and matrix provided as 3 columns.
|
|
| Transform3D (const components::Translation3D &translation_, const components::TransformMat3x3 &mat3x3_, bool from_parent=false) |
| Creates a new 3D transform from translation/matrix.
|
|
| Transform3D (const components::Translation3D &translation_, bool from_parent=false) |
| From translation only.
|
|
| Transform3D (const components::TransformMat3x3 &mat3x3_, bool from_parent=false) |
| From 3x3 matrix only.
|
|
| Transform3D (const datatypes::Vec3D(&columns)[3], bool from_parent=false) |
| From 3x3 matrix provided as 3 columns only.
|
|
| Transform3D (const components::Translation3D &translation_, const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false) |
| Creates a new 3D transform from translation/rotation/scale.
|
|
| Transform3D (const components::Translation3D &translation_, const Rotation3D &rotation, float uniform_scale, bool from_parent=false) |
| Creates a new 3D transform from translation/rotation/uniform-scale.
|
|
| Transform3D (const components::Translation3D &translation_, const Rotation3D &rotation, bool from_parent=false) |
| Creates a new rigid transform (translation & rotation only).
|
|
| Transform3D (const components::Translation3D &translation_, const components::Scale3D &scale_, bool from_parent=false) |
| From translation & scale only.
|
|
| Transform3D (const components::Translation3D &translation_, float uniform_scale, bool from_parent=false) |
| From translation & uniform scale only.
|
|
| Transform3D (const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false) |
| From rotation & scale.
|
|
| Transform3D (const Rotation3D &rotation, float uniform_scale, bool from_parent=false) |
| From rotation & uniform scale.
|
|
| Transform3D (const Rotation3D &rotation, bool from_parent=false) |
| From rotation only.
|
|
| Transform3D (const components::Scale3D &scale_, bool from_parent=false) |
| From scale only.
|
|
Transform3D | with_rotation (const Rotation3D &rotation) && |
| Set the rotation component of the transform using the rerun::Rotation3D utility.
|
|
| Transform3D (Transform3D &&other)=default |
|
| Transform3D (const Transform3D &other)=default |
|
Transform3D & | operator= (const Transform3D &other)=default |
|
Transform3D & | operator= (Transform3D &&other)=default |
|
Transform3D | with_translation (const rerun::components::Translation3D &_translation) && |
| Translation vector.
|
|
Transform3D | with_many_translation (const Collection< rerun::components::Translation3D > &_translation) && |
| This method makes it possible to pack multiple translation in a single component batch.
|
|
Transform3D | with_rotation_axis_angle (const rerun::components::RotationAxisAngle &_rotation_axis_angle) && |
| Rotation via axis + angle.
|
|
Transform3D | with_many_rotation_axis_angle (const Collection< rerun::components::RotationAxisAngle > &_rotation_axis_angle) && |
| This method makes it possible to pack multiple rotation_axis_angle in a single component batch.
|
|
Transform3D | with_quaternion (const rerun::components::RotationQuat &_quaternion) && |
| Rotation via quaternion.
|
|
Transform3D | with_many_quaternion (const Collection< rerun::components::RotationQuat > &_quaternion) && |
| This method makes it possible to pack multiple quaternion in a single component batch.
|
|
Transform3D | with_scale (const rerun::components::Scale3D &_scale) && |
| Scaling factor.
|
|
Transform3D | with_many_scale (const Collection< rerun::components::Scale3D > &_scale) && |
| This method makes it possible to pack multiple scale in a single component batch.
|
|
Transform3D | with_mat3x3 (const rerun::components::TransformMat3x3 &_mat3x3) && |
| 3x3 transformation matrix.
|
|
Transform3D | with_many_mat3x3 (const Collection< rerun::components::TransformMat3x3 > &_mat3x3) && |
| This method makes it possible to pack multiple mat3x3 in a single component batch.
|
|
Transform3D | with_relation (const rerun::components::TransformRelation &_relation) && |
| Specifies the relation this transform establishes between this entity and its parent.
|
|
Transform3D | with_many_relation (const Collection< rerun::components::TransformRelation > &_relation) && |
| This method makes it possible to pack multiple relation in a single component batch.
|
|
Transform3D | with_axis_length (const rerun::components::AxisLength &_axis_length) && |
| Visual length of the 3 axes.
|
|
Transform3D | with_many_axis_length (const Collection< rerun::components::AxisLength > &_axis_length) && |
| This method makes it possible to pack multiple axis_length in a single component batch.
|
|
Collection< ComponentColumn > | columns (const Collection< uint32_t > &lengths_) |
| Partitions the component data into multiple sub-batches.
|
|
Collection< ComponentColumn > | columns () |
| Partitions the component data into unit-length sub-batches.
|
|
Archetype: A transform between two 3D spaces, i.e.
a pose.
From the point of view of the entity's coordinate system, all components are applied in the inverse order they are listed here. E.g. if both a translation and a max3x3 transform are present, the 3x3 matrix is applied first, followed by the translation.
Whenever you log this archetype, it will write all components, even if you do not explicitly set them. This means that if you first log a transform with only a translation, and then log one with only a rotation, it will be resolved to a transform with only a rotation.
For transforms that affect only a single entity and do not propagate along the entity tree refer to archetypes::InstancePoses3D
.
Examples
Variety of 3D transforms

#include <rerun.hpp>
constexpr float TAU = 6.28318530717958647692528676655900577f;
int main() {
rec.spawn().exit_on_failure();
auto arrow =
rerun::Arrows3D::from_vectors({{0.0f, 1.0f, 0.0f}}).with_origins({{0.0f, 0.0f, 0.0f}});
rec.log("base", arrow);
rec.log("base/translated", rerun::Transform3D::from_translation({1.0f, 0.0f, 0.0f}));
rec.log("base/translated", arrow);
rec.log(
"base/rotated_scaled",
rerun::Transform3D::from_rotation_scale(
2.0f
)
);
rec.log("base/rotated_scaled", arrow);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:61
static Angle radians(float radians_)
New angle in radians.
Definition angle.hpp:30
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:21
Transform hierarchy

#include <rerun.hpp>
constexpr float TAU = 6.28318530717958647692528676655900577f;
int main() {
rec.spawn().exit_on_failure();
rec.set_time_duration_secs("sim_time", 0.0);
rec.log_static("/", rerun::ViewCoordinates::RIGHT_HAND_Z_UP);
rec.log(
"sun",
.with_radii({1.0f})
);
rec.log(
"sun/planet",
.with_radii({0.4f})
);
rec.log(
"sun/planet/moon",
.with_radii({0.15f})
);
float d_planet = 6.0f;
float d_moon = 3.0f;
std::vector<std::array<float, 3>> planet_path, moon_path;
for (int i = 0; i <= 100; i++) {
float angle = static_cast<float>(i) * 0.01f * TAU;
float circle_x = std::sin(angle);
float circle_y = std::cos(angle);
planet_path.push_back({circle_x * d_planet, circle_y * d_planet, 0.0f});
moon_path.push_back({circle_x * d_moon, circle_y * d_moon, 0.0f});
}
for (int i = 0; i <6 * 120; i++) {
float time = static_cast<float>(i) / 120.0f;
rec.set_time_duration_secs("sim_time", time);
float r_moon = time * 5.0f;
float r_planet = time * 2.0f;
rec.log(
"sun/planet",
rerun::Transform3D::from_translation_rotation(
{std::sin(r_planet) * d_planet, std::cos(r_planet) * d_planet, 0.0f},
{1.0, 0.0f, 0.0f},
}
)
);
rec.log(
"sun/planet/moon",
rerun::Transform3D::from_translation(
{std::cos(r_moon) * d_moon, std::sin(r_moon) * d_moon, 0.0f}
)
);
}
}
@ ChildFromParent
The transform describes how to transform into the child entity's space.
Archetype: 3D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips3d.hpp:102
Archetype: A 3D point cloud with positions and optional colors, radii, labels, etc.
Definition points3d.hpp:174
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17
Component: A line strip in 3D space.
Definition line_strip3d.hpp:33
static Angle degrees(float degrees_)
New angle in degrees.
Definition angle.hpp:39
Update a transform over time

#include <rerun.hpp>
float truncated_radians(int deg) {
auto degf = static_cast<float>(deg);
const auto pi = 3.14159265358979323846f;
return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
}
int main() {
rec.spawn().exit_on_failure();
rec.set_time_sequence("tick", 0);
rec.log(
"box",
rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
);
for (int t = 0; t <100; t++) {
rec.set_time_sequence("tick", t + 1);
rec.log(
"box",
{0.0f, 1.0f, 0.0f},
))
);
}
}
Update a transform over time, in a single operation

#include <cmath>
#include <numeric>
#include <vector>
#include <rerun.hpp>
float truncated_radians(int deg) {
auto degf = static_cast<float>(deg);
const auto pi = 3.14159265358979323846f;
return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
}
int main() {
rec.spawn().exit_on_failure();
rec.set_time_sequence("tick", 0);
rec.log(
"box",
rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
);
std::vector<std::array<float, 3>> translations;
std::vector<rerun::RotationAxisAngle> rotations;
for (int t = 0; t <100; t++) {
translations.push_back({0.0f, 0.0f, static_cast<float>(t) / 10.0f});
{0.0f, 1.0f, 0.0f},
));
}
std::vector<int64_t> ticks(100);
std::iota(ticks.begin(), ticks.end(), 1);
rec.send_columns(
"box",
);
}
static TimeColumn from_sequence(std::string timeline_name, Collection< int64_t > sequence_points, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a column from an array of sequence points, e.g.
Definition time_column.hpp:92
Update specific properties of a transform over time

#include <rerun.hpp>
float truncated_radians(int deg) {
auto degf = static_cast<float>(deg);
const auto pi = 3.14159265358979323846f;
return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
}
int main() {
rec.spawn().exit_on_failure();
rec.log(
"box",
rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
);
for (int deg = 0; deg <= 45; deg++) {
auto rad = truncated_radians(deg * 4);
rec.log(
"box",
)
);
}
for (int t = 0; t <= 50; t++) {
rec.log(
"box",
rerun::Transform3D::update_fields().with_translation(
{0.0f, 0.0f, static_cast<float>(t) / 10.0f}
)
);
}
for (int deg = 0; deg <= 45; deg++) {
auto rad = truncated_radians((deg + 45) * 4);
rec.log(
"box",
)
);
}
rec.log("box", rerun::Transform3D::clear_fields().with_axis_length(15.0));
}