mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Added ModelInstance::world_matrix() method and stl_transform using eigen transform
This commit is contained in:
parent
5f2afad95e
commit
15b1340514
8 changed files with 89 additions and 46 deletions
|
@ -1051,6 +1051,8 @@ void GLGizmoFlatten::on_render(const BoundingBoxf3& box) const
|
|||
::glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
::glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
void GLGizmoFlatten::on_render_for_picking(const BoundingBoxf3& box) const
|
||||
|
@ -1278,9 +1280,7 @@ bool GLGizmoFlatten::is_plane_update_necessary() const
|
|||
}
|
||||
|
||||
Vec3d GLGizmoFlatten::get_flattening_normal() const {
|
||||
Transform3d m = Transform3d::Identity();
|
||||
m.rotate(Eigen::AngleAxisd(-m_model_object->instances.front()->rotation, Vec3d::UnitZ()));
|
||||
Vec3d normal = m * m_normal;
|
||||
Vec3d normal = m_model_object->instances.front()->world_matrix().matrix().block(0, 0, 3, 3) * m_normal;
|
||||
m_normal = Vec3d::Zero();
|
||||
return normal;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue