Fix ortho camera position for create object on bed

This commit is contained in:
Filip Sykala - NTB T15p 2022-11-23 16:41:45 +01:00
parent 22a17e92e7
commit c25ef9d3ad

View File

@ -81,6 +81,11 @@ Slic3r::Polygon CameraUtils::create_hull2d(const Camera & camera,
#include <igl/unproject.h> #include <igl/unproject.h>
Vec3d CameraUtils::create_ray(const Camera &camera, const Vec2d &coor) { Vec3d CameraUtils::create_ray(const Camera &camera, const Vec2d &coor) {
if (camera.get_type() == Camera::EType::Ortho)
return camera.get_dir_forward();
// check that it is known camera no other tha ORTHO or Persepective
assert(camera.get_type() == Camera::EType::Perspective);
Matrix4d modelview = camera.get_view_matrix().matrix(); Matrix4d modelview = camera.get_view_matrix().matrix();
Matrix4d projection = camera.get_projection_matrix().matrix(); Matrix4d projection = camera.get_projection_matrix().matrix();
Vec4i viewport(camera.get_viewport().data()); Vec4i viewport(camera.get_viewport().data());