Heyo all, I'm having a bit of a strange problem. The following segment of my app:
...is drawing lines that are *2* pixels in width. If I increase the line width, the outputted line width increases, if it take it down to (for example) 0.001 it still takes up 2 pixels in the ouput, when logically it should take 1 or none, rite?... My viewport is scaled (and tested at this because I'm drawing other things - chiefly little circles) so that one pixel equals one gl unit, but it also acted in this way when I had the window scaled so the gl units went from -1 to 1 from left to right and bottom to top of my window.PHP Code:glDisable(GL_BLEND);
glLineWidth(1.0);
glColor3f(0.0, 0.0, 0.0);
glBegin(GL_LINE_LOOP);
point.m_i = 0 - NODE_CLEARANCE;
point.m_j = 0 - NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
point.m_i = doc.width - 1 + NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
point.m_j = doc.height - 1 + NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
point.m_i = 0 - NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
glEnd();
glEnable(GL_BLEND);
// note to those reading this code:
// WindowToGlCoords basically just inverts the y coord
// MakeWindowCoords converts the units relative to the
// origin of the active document to relative to the window
// point is a variable of type Vector (a 3d vector class
// I made for my app.
// The two aforementioned functions take and return vectors
// the glVertex3d member function of the Vector class
// calls opengl's glVertex3d function with the coords of the vector
// In breif: the problem does not lie there, as i've tried using
// static coords with the same results.
Another problem that might be related (and thus possibly help diagnose the problem???) is that if blending is enabled while I paint a white rectangle:
...then it displays a very very thin diagonal grey line through my window, which is not visible when I turn off blending.PHP Code:glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
point.m_i = 0 - NODE_CLEARANCE;
point.m_j = 0 - NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
point.m_i = doc.width - 1 + NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
point.m_j = doc.height - 1 + NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
point.m_i = 0 - NODE_CLEARANCE;
WindowToGlCoords(MakeWindowCoords(point)).glVertex3d();
glEnd();
Anyone got any ideas on whats going on?![]()
![]()
Thanks,
Jeff



LinkBack URL
About LinkBacks



