@@ -62,11 +62,40 @@ int main() {
62
62
63
63
// Points represented by std::vector<Eigen::Vector3f>
64
64
auto points3d_vector = generate_random_points_vector (1000 );
65
- rec.log (" points_from_vector" , rerun::Points3D (points3d_vector));
65
+ rec.log (" world/ points_from_vector" , rerun::Points3D (points3d_vector));
66
66
67
67
// Points represented by Eigen::MatX3f (Nx3 matrix)
68
68
Eigen::MatrixX3f points3d_matrix = Eigen::MatrixX3f::Random (num_points, 3 );
69
- rec.log (" points_from_matrix" , rerun::Points3D (points3d_matrix));
69
+ rec.log (" world/points_from_matrix" , rerun::Points3D (points3d_matrix));
70
+
71
+ // Posed pinhole camera
72
+ float width = 640 .0f ;
73
+ float height = 480 .0f ;
74
+ Eigen::Matrix3f projection_matrix = Eigen::Matrix3f::Identity ();
75
+ projection_matrix (0 , 0 ) = 500 .0f ;
76
+ projection_matrix (1 , 1 ) = 500 .0f ;
77
+ projection_matrix (0 , 2 ) = (width - 1 ) / 2.0 ;
78
+ projection_matrix (1 , 2 ) = (height - 1 ) / 2.0 ;
79
+ rec.log (
80
+ " world/camera" ,
81
+ rerun::Pinhole (rerun::components::PinholeProjection (*(float (*)[9 ])projection_matrix.data ()))
82
+ .with_resolution (rerun::components::Resolution ({width, height}))
83
+ );
84
+ Eigen::Vector3f camera_position{0.0 , -1.0 , 0.0 };
85
+ Eigen::Matrix3f camera_orientation;
86
+ // clang-format off
87
+ camera_orientation <<
88
+ 0.0 , 1.0 , 0.0 ,
89
+ 0.0 , 0.0 , 1.0 ,
90
+ 1.0 , 0.0 , 0.0 ;
91
+ // clang-format on
92
+ rec.log (
93
+ " world/camera" ,
94
+ rerun::Transform3D (
95
+ rerun::datatypes::Vec3D (*(float (*)[3 ])camera_position.data ()),
96
+ rerun::datatypes::Mat3x3 (*(float (*)[9 ])camera_orientation.data ())
97
+ )
98
+ );
70
99
71
100
// Image
72
101
std::string image_path = " rerun-logo.png" ;
0 commit comments