Skip to content
Snippets Groups Projects
Commit 4315ff96 authored by Ali Can Demiralp's avatar Ali Can Demiralp
Browse files

Fix camera positioning in scatter plot widget.

parent e424e62f
Branches
No related tags found
No related merge requests found
......@@ -44,9 +44,16 @@ scatter_plot_widget::scatter_plot_widget (QWidget* p_parent)
, mp_viewer_frame (new QFrame ())
, mp_grid_layout (new QGridLayout ())
{
mp_camera->set_lambda (0 );
mp_camera->set_phi (0 );
mp_camera->set_distance(10 );
mp_camera->set_near (0.01 );
mp_camera->set_far (10000);
mp_camera->set_coi (Eigen::Vector3f(0, 0, 0));
mp_scene ->add_renderable (mp_renderable_scatter_plot.get());
mp_viewer_widget->set_scene (mp_scene.get());
mp_viewer_widget->set_clear_color (1.0, 1.0, 1.0, 1.0);
//mp_viewer_widget->set_clear_color (1.0, 1.0, 1.0, 1.0);
mp_viewer_frame = new QFrame;
mp_viewer_frame ->setLayout (new QHBoxLayout );
......@@ -60,11 +67,11 @@ scatter_plot_widget::scatter_plot_widget (QWidget* p_parent)
setMinimumSize(256, 256);
// TODO: Set renderable scatter plot entries from actual data.
for (auto i = 0; i < 100; i++)
for (auto i = 0; i < 250; i++)
mp_renderable_scatter_plot->add_entry({Eigen::Vector3f(
static_cast <float> (rand()) / static_cast <float> (RAND_MAX),
static_cast <float> (rand()) / static_cast <float> (RAND_MAX),
0.0), false });
2 * (static_cast <float> (rand()) / static_cast <float> (RAND_MAX) - 0.5),
2 * (static_cast <float> (rand()) / static_cast <float> (RAND_MAX) - 0.5),
2 * (static_cast <float> (rand()) / static_cast <float> (RAND_MAX) - 0.5)), false });
// Handle resize: Get device pixel ratio and apply to clickable scene size.
QObject::connect(mp_viewer_widget, &viewer_widget::resized, [&]()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment