@@ -71,21 +71,12 @@ int main() {
71
71
const Eigen::MatrixX3f points3d_matrix = Eigen::MatrixX3f::Random (num_points, 3 );
72
72
rec.log (" world/points_from_matrix" , rerun::Points3D (points3d_matrix));
73
73
74
- // Posed pinhole camera
75
- float width = 640 .0f ;
76
- float height = 480 .0f ;
77
- Eigen::Matrix3f projection_matrix = Eigen::Matrix3f::Identity ();
78
- projection_matrix (0 , 0 ) = 500 .0f ;
79
- projection_matrix (1 , 1 ) = 500 .0f ;
80
- projection_matrix (0 , 2 ) = (width - 1 ) / 2.0 ;
81
- projection_matrix (1 , 2 ) = (height - 1 ) / 2.0 ;
74
+ // Posed pinhole camera:
82
75
rec.log (
83
76
" world/camera" ,
84
- rerun::Pinhole (rerun::components::PinholeProjection (
85
- *reinterpret_cast <float (*)[9 ]>(projection_matrix.data ())
86
- ))
87
- .with_resolution (rerun::components::Resolution ({width, height}))
77
+ rerun::Pinhole::focal_length_and_resolution ({500.0 , 500.0 }, {640.0 , 480.0 })
88
78
);
79
+
89
80
const Eigen::Vector3f camera_position{0.0 , -1.0 , 0.0 };
90
81
Eigen::Matrix3f camera_orientation;
91
82
// clang-format off
@@ -97,9 +88,8 @@ int main() {
97
88
rec.log (
98
89
" world/camera" ,
99
90
rerun::Transform3D (
100
- rerun::datatypes::Vec3D (*reinterpret_cast <const float (*)[3 ]>(camera_position.data ())),
101
- rerun::datatypes::Mat3x3 (*reinterpret_cast <const float (*)[9 ]>(camera_orientation.data ())
102
- )
91
+ rerun::datatypes::Vec3D (camera_position.data ()),
92
+ rerun::datatypes::Mat3x3 (camera_orientation.data ())
103
93
)
104
94
);
105
95
0 commit comments