mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 13:06:03 +08:00
Fix in debug tech ENABLE_SHOW_CAMERA_TARGET
This commit is contained in:
parent
bcaa0d38bd
commit
05dec1bee9
@ -5610,25 +5610,25 @@ void GLCanvas3D::_render_view_toolbar() const
|
|||||||
#if ENABLE_SHOW_CAMERA_TARGET
|
#if ENABLE_SHOW_CAMERA_TARGET
|
||||||
void GLCanvas3D::_render_camera_target() const
|
void GLCanvas3D::_render_camera_target() const
|
||||||
{
|
{
|
||||||
double half_length = 5.0;
|
static const double half_length = 5.0;
|
||||||
|
|
||||||
glsafe(::glDisable(GL_DEPTH_TEST));
|
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||||
|
|
||||||
glsafe(::glLineWidth(2.0f));
|
glsafe(::glLineWidth(2.0f));
|
||||||
::glBegin(GL_LINES);
|
::glBegin(GL_LINES);
|
||||||
const Vec3d& target = m_camera.get_target();
|
const Vec3d& target = wxGetApp().plater()->get_camera().get_target();
|
||||||
// draw line for x axis
|
// draw line for x axis
|
||||||
::glColor3f(1.0f, 0.0f, 0.0f);
|
::glColor3f(1.0f, 0.0f, 0.0f);
|
||||||
::glVertex3d(target(0) - half_length, target(1), target(2));
|
::glVertex3d(target.x() - half_length, target.y(), target.z());
|
||||||
::glVertex3d(target(0) + half_length, target(1), target(2));
|
::glVertex3d(target.x() + half_length, target.y(), target.z());
|
||||||
// draw line for y axis
|
// draw line for y axis
|
||||||
::glColor3f(0.0f, 1.0f, 0.0f);
|
::glColor3f(0.0f, 1.0f, 0.0f);
|
||||||
::glVertex3d(target(0), target(1) - half_length, target(2));
|
::glVertex3d(target.x(), target.y() - half_length, target.z());
|
||||||
::glVertex3d(target(0), target(1) + half_length, target(2));
|
::glVertex3d(target.x(), target.y() + half_length, target.z());
|
||||||
// draw line for z axis
|
// draw line for z axis
|
||||||
::glColor3f(0.0f, 0.0f, 1.0f);
|
::glColor3f(0.0f, 0.0f, 1.0f);
|
||||||
::glVertex3d(target(0), target(1), target(2) - half_length);
|
::glVertex3d(target.x(), target.y(), target.z() - half_length);
|
||||||
::glVertex3d(target(0), target(1), target(2) + half_length);
|
::glVertex3d(target.x(), target.y(), target.z() + half_length);
|
||||||
glsafe(::glEnd());
|
glsafe(::glEnd());
|
||||||
}
|
}
|
||||||
#endif // ENABLE_SHOW_CAMERA_TARGET
|
#endif // ENABLE_SHOW_CAMERA_TARGET
|
||||||
|
Loading…
x
Reference in New Issue
Block a user