mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 02:49:04 +08:00
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Use 2D vertices to render GLGizmoPainterBase circle
This commit is contained in:
parent
b2fba940fe
commit
5193a15852
@ -192,7 +192,7 @@ void GLGizmoPainterBase::render_cursor_circle()
|
|||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
static const unsigned int StepsCount = 32;
|
static const unsigned int StepsCount = 32;
|
||||||
static const float StepSize = 2.0f * float(PI) / float(StepsCount);
|
static const float StepSize = 2.0f * float(PI) / float(StepsCount);
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.color = { 0.0f, 1.0f, 0.3f, 1.0f };
|
init_data.color = { 0.0f, 1.0f, 0.3f, 1.0f };
|
||||||
init_data.reserve_vertices(StepsCount);
|
init_data.reserve_vertices(StepsCount);
|
||||||
init_data.reserve_indices(StepsCount);
|
init_data.reserve_indices(StepsCount);
|
||||||
@ -200,7 +200,7 @@ void GLGizmoPainterBase::render_cursor_circle()
|
|||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned short i = 0; i < StepsCount; ++i) {
|
for (unsigned short i = 0; i < StepsCount; ++i) {
|
||||||
const float angle = float(i * StepSize);
|
const float angle = float(i * StepSize);
|
||||||
init_data.add_vertex(Vec3f(center.x() + ::cos(angle) * m_cursor_radius, center.y() + ::sin(angle) * m_cursor_radius, 0.0f));
|
init_data.add_vertex(Vec2f(center.x() + ::cos(angle) * m_cursor_radius, center.y() + ::sin(angle) * m_cursor_radius));
|
||||||
init_data.add_ushort_index(i);
|
init_data.add_ushort_index(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user