mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 15:07:31 -06:00
QoL: 3D navigator (#4181)
* Initial integration of ImGuizmo * Fix mouse capture * Fix frame update * Update face color * Show current camera rotation * Fix coord mapping * Update camera rotation from 3d navigator * Use orthographic * Render axis * Make the axis color lighter if at back * Show axis label * Fix linux build * Move to separate method * Refine * Add option to show/hide 3d navigator * Add license info * Handle dpi scaling --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
4991a3d312
commit
bf4d59a676
15 changed files with 3695 additions and 1 deletions
|
@ -419,6 +419,15 @@ void Camera::rotate_local_around_target(const Vec3d& rotation_rad)
|
|||
}
|
||||
}
|
||||
|
||||
void Camera::set_rotation(const Transform3d& rotation)
|
||||
{
|
||||
const Vec3d translation = m_view_matrix.translation() + m_view_rotation * m_target;
|
||||
m_view_rotation = Eigen::Quaterniond(rotation.matrix().template block<3, 3>(0, 0));
|
||||
m_view_rotation.normalize();
|
||||
m_view_matrix.fromPositionOrientationScale(m_view_rotation * (-m_target) + translation, m_view_rotation, Vec3d(1., 1., 1.));
|
||||
update_zenit();
|
||||
}
|
||||
|
||||
std::pair<double, double> Camera::calc_tight_frustrum_zs_around(const BoundingBoxf3& box)
|
||||
{
|
||||
std::pair<double, double> ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue