mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 19:15:56 +08:00
Merge branch 'lm_axes_scale'
This commit is contained in:
commit
4475753247
@ -44,17 +44,23 @@ void CoordAxes::render(const Transform3d& trafo, float emission_factor)
|
|||||||
shader->start_using();
|
shader->start_using();
|
||||||
shader->set_uniform("emission_factor", emission_factor);
|
shader->set_uniform("emission_factor", emission_factor);
|
||||||
|
|
||||||
|
// Scale the axes if the camera is close to them to avoid issues
|
||||||
|
// such as https://github.com/prusa3d/PrusaSlicer/issues/9483
|
||||||
|
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||||
|
Transform3d scale_tr = Transform3d::Identity();
|
||||||
|
scale_tr.scale(std::min(1., camera.get_inv_zoom() * 10.));
|
||||||
|
|
||||||
// x axis
|
// x axis
|
||||||
m_arrow.set_color(ColorRGBA::X());
|
m_arrow.set_color(ColorRGBA::X());
|
||||||
render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ 0.0, 0.5 * M_PI, 0.0 }));
|
render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ 0.0, 0.5 * M_PI, 0.0 }) * scale_tr);
|
||||||
|
|
||||||
// y axis
|
// y axis
|
||||||
m_arrow.set_color(ColorRGBA::Y());
|
m_arrow.set_color(ColorRGBA::Y());
|
||||||
render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ -0.5 * M_PI, 0.0, 0.0 }));
|
render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ -0.5 * M_PI, 0.0, 0.0 }) * scale_tr);
|
||||||
|
|
||||||
// z axis
|
// z axis
|
||||||
m_arrow.set_color(ColorRGBA::Z());
|
m_arrow.set_color(ColorRGBA::Z());
|
||||||
render_axis(*shader, trafo * Geometry::translation_transform(m_origin));
|
render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * scale_tr);
|
||||||
|
|
||||||
shader->stop_using();
|
shader->stop_using();
|
||||||
if (curr_shader != nullptr)
|
if (curr_shader != nullptr)
|
||||||
|
@ -1572,8 +1572,7 @@ void GLCanvas3D::render()
|
|||||||
_render_objects(GLVolumeCollection::ERenderType::Opaque);
|
_render_objects(GLVolumeCollection::ERenderType::Opaque);
|
||||||
_render_sla_slices();
|
_render_sla_slices();
|
||||||
_render_selection();
|
_render_selection();
|
||||||
if (m_show_bed_axes)
|
_render_bed_axes();
|
||||||
_render_bed_axes();
|
|
||||||
if (is_looking_downward)
|
if (is_looking_downward)
|
||||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), false);
|
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), false);
|
||||||
if (!m_main_toolbar.is_enabled())
|
if (!m_main_toolbar.is_enabled())
|
||||||
@ -2351,15 +2350,6 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
|||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
post_event(SimpleEvent(EVT_GLTOOLBAR_COPY));
|
post_event(SimpleEvent(EVT_GLTOOLBAR_COPY));
|
||||||
break;
|
break;
|
||||||
#ifdef __APPLE__
|
|
||||||
case 'd':
|
|
||||||
case 'D':
|
|
||||||
#else /* __APPLE__ */
|
|
||||||
case WXK_CONTROL_D:
|
|
||||||
#endif /* __APPLE__ */
|
|
||||||
m_show_bed_axes = !m_show_bed_axes;
|
|
||||||
m_dirty = true;
|
|
||||||
break;
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
case 'f':
|
case 'f':
|
||||||
case 'F':
|
case 'F':
|
||||||
|
@ -522,7 +522,6 @@ private:
|
|||||||
ECursorType m_cursor_type;
|
ECursorType m_cursor_type;
|
||||||
GLSelectionRectangle m_rectangle_selection;
|
GLSelectionRectangle m_rectangle_selection;
|
||||||
std::vector<int> m_hover_volume_idxs;
|
std::vector<int> m_hover_volume_idxs;
|
||||||
bool m_show_bed_axes{ true };
|
|
||||||
|
|
||||||
// Following variable is obsolete and it should be safe to remove it.
|
// Following variable is obsolete and it should be safe to remove it.
|
||||||
// I just don't want to do it now before a release (Lukas Matena 24.3.2019)
|
// I just don't want to do it now before a release (Lukas Matena 24.3.2019)
|
||||||
|
@ -151,7 +151,6 @@ void KBShortcutsDialog::fill_shortcuts()
|
|||||||
{ L("Arrow Right"), L("Move selection 10 mm in positive X direction") },
|
{ L("Arrow Right"), L("Move selection 10 mm in positive X direction") },
|
||||||
{ std::string("Shift+") + L("Any arrow"), L("Movement step set to 1 mm") },
|
{ std::string("Shift+") + L("Any arrow"), L("Movement step set to 1 mm") },
|
||||||
{ ctrl + L("Any arrow"), L("Movement in camera space") },
|
{ ctrl + L("Any arrow"), L("Movement in camera space") },
|
||||||
{ ctrl + "D", L("Show/hide reference axes") },
|
|
||||||
{ L("Page Up"), L("Rotate selection 45 degrees CCW") },
|
{ L("Page Up"), L("Rotate selection 45 degrees CCW") },
|
||||||
{ L("Page Down"), L("Rotate selection 45 degrees CW") },
|
{ L("Page Down"), L("Rotate selection 45 degrees CW") },
|
||||||
{ "M", L("Gizmo move") },
|
{ "M", L("Gizmo move") },
|
||||||
@ -232,7 +231,6 @@ void KBShortcutsDialog::fill_shortcuts()
|
|||||||
{ "X", L("On/Off one layer mode of the vertical slider") },
|
{ "X", L("On/Off one layer mode of the vertical slider") },
|
||||||
{ "L", L("Show/Hide legend") },
|
{ "L", L("Show/Hide legend") },
|
||||||
{ "C", L("Show/Hide G-code window") },
|
{ "C", L("Show/Hide G-code window") },
|
||||||
{ ctrl + "D", L("Show/hide reference axes") },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
m_full_shortcuts.push_back({ { _L("Preview"), "" }, preview_shortcuts });
|
m_full_shortcuts.push_back({ { _L("Preview"), "" }, preview_shortcuts });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user