1
#include "test_precomp.hpp"
9
viz::Viz3d myWindow("Coordinate Frame");
11
/// Add coordinate axes
12
myWindow.showWidget("Coordinate Widget", viz::WCoordinateSystem());
14
/// Add line to represent (1,1,1) axis
15
viz::WLine axis(Point3f(-1.0, -1.0, -1.0), Point3d(1.0, 1.0, 1.0));
16
axis.setRenderingProperty(viz::LINE_WIDTH, 4.0);
17
myWindow.showWidget("Line Widget", axis);
19
/// Construct a cube widget
20
viz::WCube cube_widget(Point3d(0.5, 0.5, 0.0), Point3d(0.0, 0.0, -0.5), true, viz::Color::blue());
21
cube_widget.setRenderingProperty(viz::LINE_WIDTH, 4.0);
23
/// Display widget (update if already displayed)
24
myWindow.showWidget("Cube Widget", cube_widget);
27
Vec3d rot_vec = Vec3d::all(0);
28
double translation_phase = 0.0, translation = 0.0;
29
while(!myWindow.wasStopped())
31
/* Rotation using rodrigues */
32
/// Rotate around (1,1,1)
33
rot_vec[0] += CV_PI * 0.01;
34
rot_vec[1] += CV_PI * 0.01;
35
rot_vec[2] += CV_PI * 0.01;
38
translation_phase += CV_PI * 0.01;
39
translation = sin(translation_phase);
42
Affine3d pose(rot_vec, Vec3d(translation, translation, translation));
44
myWindow.setWidgetPose("Cube Widget", pose);
46
myWindow.spinOnce(1, true);
51
TEST(Viz, DISABLED_tutorial2_pose_of_widget)