|
| 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 (Transform3D &&other)=default |
|
Transform3D | with_translation (rerun::components::Translation3D _translation) && |
| Translation vector.
|
|
Transform3D | with_rotation_axis_angle (rerun::components::RotationAxisAngle _rotation_axis_angle) && |
| Rotation via axis + angle.
|
|
Transform3D | with_quaternion (rerun::components::RotationQuat _quaternion) && |
| Rotation via quaternion.
|
|
Transform3D | with_scale (rerun::components::Scale3D _scale) && |
| Scaling factor.
|
|
Transform3D | with_mat3x3 (rerun::components::TransformMat3x3 _mat3x3) && |
| 3x3 transformation matrix.
|
|
Transform3D | with_relation (rerun::components::TransformRelation _relation) && |
| Specifies the relation this transform establishes between this entity and its parent.
|
|
Transform3D | with_axis_length (rerun::components::AxisLength _axis_length) && |
| Visual length of the 3 axes.
|
|
|
static Transform3D | from_translation_mat3x3 (const components::Translation3D &translation, const components::TransformMat3x3 &mat3x3) |
| From a translation applied after a 3x3 matrix.
|
|
static Transform3D | from_translation_mat3x3 (const components::Translation3D &translation, const datatypes::Vec3D(&columns)[3]) |
| From a translation applied after a 3x3 matrix provided as 3 columns.
|
|
static Transform3D | from_translation (const components::Translation3D &translation) |
| From a translation.
|
|
static Transform3D | from_mat3x3 (const components::TransformMat3x3 &mat3x3) |
| From 3x3 matrix only.
|
|
static Transform3D | from_mat3x3 (const datatypes::Vec3D(&columns)[3]) |
| From 3x3 matrix provided as 3 columns only.
|
|
static Transform3D | from_translation_rotation_scale (const components::Translation3D &translation, const Rotation3D &rotation, const components::Scale3D &scale) |
| From a translation, applied after a rotation & scale, known as an affine transformation.
|
|
static Transform3D | from_translation_rotation_scale (const components::Translation3D &translation, const Rotation3D &rotation, float uniform_scale) |
| From a translation, applied after a rotation & scale, known as an affine transformation.
|
|
static Transform3D | from_translation_rotation (const components::Translation3D &translation, const Rotation3D &rotation) |
| From a rotation & scale.
|
|
static Transform3D | from_translation_scale (const components::Translation3D &translation, const components::Scale3D &scale) |
| From a translation applied after a scale.
|
|
static Transform3D | from_rotation_scale (const Rotation3D &rotation, const components::Scale3D &scale) |
| From a rotation & scale.
|
|
static Transform3D | from_rotation_scale (const Rotation3D &rotation, float uniform_scale) |
| From a rotation & uniform scale.
|
|
static Transform3D | from_rotation (const Rotation3D &rotation) |
| From rotation only.
|
|
static Transform3D | from_scale (const components::Scale3D &scale) |
| From scale only.
|
|
static Transform3D | from_scale (float uniform_scale) |
| From scale only.
|
|
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.
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:60
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_seconds("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_seconds("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:155
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