Changing view point in C++
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
Hi everybody,
I want to change the view point of the visualizer in C++, but it does not work and I am running out of ideas why that is. No matter what I set front_, lookat_ or up_ to, it doesn’t change the view in the visualizer window. Here is a minimal toy example:
```
// Create Visualizer and point cloud
open3d::visualization::Visualizer vis;
vis.CreateVisualizerWindow("Open3D");
std::vector points = std::vector();
for (int i = 0; i < 1000; i++)
{
auto tmp = Eigen::Vector3d(rand() % 100, rand() % 100, rand() % 100);
points.push_back(tmp);
}
open3d::geometry::PointCloud point_cloud = open3d::geometry::PointCloud(points);
std::shared_ptr cloud_ptr = std::make_shared(point_cloud);
vis.AddGeometry(cloud_ptr);
// Change view
open3d::visualization::ViewControl view_control = vis.GetViewControl();
auto view_params = open3d::visualization::ViewParameters();
view_control.ConvertToViewParameters(view_params);
view_params.front_ = Eigen::Vector3d(15, 30, 0);
view_params.lookat_ = Eigen::Vector3d(2, 5, -0.3);
view_params.up_ = Eigen::Vector3d(4, -1, 0);
view_control.ConvertFromViewParameters(view_params);
while (true)
{
vis.UpdateGeometry();
vis.UpdateRender();
vis.PollEvents();
}
```
I can not find any examples of this, so any advice would be greatly appreciated.
best regards!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.