I am trying to draw a dashed line in OpenGl using a texture equally spaced along the path as the dashes. I can get a solid line, but that wont work for this project. Could someone help point me in the right direction?
A dash is a little horizontal line that floats in the middle of a line of text (not at the bottom: that's an underscore). It's longer than a hyphen and is commonly used to indicate a range or a pause. Dashes are used to separate groups of words, not to separate parts of words like a hyphen does.
The dashed or dotted line is known to diminish the boundary strength of an object, reducing its salience, which is one reason we interpret it as “lesser” than an object with a solid line. When you see a speech bubble outlined with a dashed line, you might interpret it as a whisper or an “off-stage” comment.
Dotted or dashed line in OpenGL is called stippled.
glPushAttrib(GL_ENABLE_BIT);
# glPushAttrib is done to return everything to normal after drawing
glLineStipple(1, 0xAAAA); # [1]
glEnable(GL_LINE_STIPPLE);
glBegin(GL_LINES);
glVertex3f(-.5,.5,-.5);
glVertex3f(.5,.5,-.5);
glEnd();
glPopAttrib();
0xAAAA is the parameter you want to experiment with.
(Sourced from here)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With