Mimic wireframe thickness
parent
61869d89dd
commit
e84f37a518
|
@ -480,6 +480,14 @@ void ModelWidget::paintGL()
|
||||||
#ifdef GL_LINE_SMOOTH
|
#ifdef GL_LINE_SMOOTH
|
||||||
f->glEnable(GL_LINE_SMOOTH);
|
f->glEnable(GL_LINE_SMOOTH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The built-in line width settings is not been well supported on all platforms,
|
||||||
|
// for example, the line range on 5.15.57.1-microsoft-standard-WSL2 is 1,
|
||||||
|
// that means the wireframe will not looking good,
|
||||||
|
// hence, we use the polygon offset to mimic thickness of wireframes
|
||||||
|
f->glEnable(GL_POLYGON_OFFSET_FILL);
|
||||||
|
f->glPolygonOffset(1.0, 1.0);
|
||||||
|
|
||||||
f->glViewport(0, 0, m_widthInPixels, m_heightInPixels);
|
f->glViewport(0, 0, m_widthInPixels, m_heightInPixels);
|
||||||
|
|
||||||
m_world.setToIdentity();
|
m_world.setToIdentity();
|
||||||
|
|
|
@ -10,9 +10,9 @@ typedef struct
|
||||||
GLfloat posX;
|
GLfloat posX;
|
||||||
GLfloat posY;
|
GLfloat posY;
|
||||||
GLfloat posZ;
|
GLfloat posZ;
|
||||||
GLfloat colorR = 1.0;
|
GLfloat colorR = 0.0;
|
||||||
GLfloat colorG = 1.0;
|
GLfloat colorG = 0.0;
|
||||||
GLfloat colorB = 1.0;
|
GLfloat colorB = 0.0;
|
||||||
GLfloat alpha = 1.0;
|
GLfloat alpha = 1.0;
|
||||||
} MonochromeOpenGLVertex;
|
} MonochromeOpenGLVertex;
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
Loading…
Reference in New Issue