mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 21:05:56 +08:00
Gizmo measure - Fixed orientation of arrows in arc dimensioning
This commit is contained in:
parent
9ca9fa4752
commit
45e6dbab8f
@ -1292,7 +1292,7 @@ void GLGizmoMeasure::render_dimensioning()
|
|||||||
const double angle = (endpoint_id == 1) ? 0.0 : step * double(resolution);
|
const double angle = (endpoint_id == 1) ? 0.0 : step * double(resolution);
|
||||||
const Vec3d position_model = Geometry::translation_transform(center) * (draw_radius * (Eigen::Quaternion<double>(Eigen::AngleAxisd(angle, normal)) * e1_unit));
|
const Vec3d position_model = Geometry::translation_transform(center) * (draw_radius * (Eigen::Quaternion<double>(Eigen::AngleAxisd(angle, normal)) * e1_unit));
|
||||||
const Vec3d direction_model = (endpoint_id == 1) ? -normal.cross(position_model - center).normalized() : normal.cross(position_model - center).normalized();
|
const Vec3d direction_model = (endpoint_id == 1) ? -normal.cross(position_model - center).normalized() : normal.cross(position_model - center).normalized();
|
||||||
const auto qz = Eigen::Quaternion<double>::FromTwoVectors(Vec3d::UnitZ(), normal);
|
const auto qz = Eigen::Quaternion<double>::FromTwoVectors(Vec3d::UnitZ(), (endpoint_id == 1) ? normal : -normal);
|
||||||
const auto qx = Eigen::Quaternion<double>::FromTwoVectors(qz * Vec3d::UnitX(), direction_model);
|
const auto qx = Eigen::Quaternion<double>::FromTwoVectors(qz * Vec3d::UnitX(), direction_model);
|
||||||
const Transform3d view_model_matrix = camera.get_view_matrix() * Geometry::translation_transform(position_model) *
|
const Transform3d view_model_matrix = camera.get_view_matrix() * Geometry::translation_transform(position_model) *
|
||||||
qx * qz * Geometry::scale_transform(camera.get_inv_zoom());
|
qx * qz * Geometry::scale_transform(camera.get_inv_zoom());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user