OpenGl 3D Line Style

Everything related to 3D programming
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

OpenGl 3D Line Style

Post by IdeasVacuum »

It should be possible to define lines with a simple pattern using glLineStipple()

Dashed = 255 (0x00FF) ;Dash-dot-dash = 7239 (0x1C47) ;Dotted = 257 (0x0101)

Code: Select all

  glLineWidth_(2)
    glColor3f_(1.0, 0.2000, 0.2549)
     glEnable_(#GL_LINE_STIPPLE)
glLineStipple_(2, 255)
   glVertex3d_(5.5, 5.0, 0.0)
   glVertex3d_(200.0, 5.0, 0.0)
    glDisable_(#GL_LINE_STIPPLE)
        glEnd_()
The above example draws the line, but no line style.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
alter Mann
User
User
Posts: 39
Joined: Fri Oct 17, 2014 8:52 pm

Re: OpenGl 3D Line Style

Post by alter Mann »

GL_INVALID_OPERATION is generated if glLineStipple is executed between the execution of glBegin and the corresponding execution of glEnd.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: OpenGl 3D Line Style

Post by IdeasVacuum »

...... Well that could have something to do with it :mrgreen:

Thanks alter Mann
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply