Forums > Jitter

dotted lines – gl line stipple

April 11, 2006 | 2:25 pm

can anyone explain to me how I can use gl line stipple to draw a dotted line?

below is what i have so far but it gives me an error:

ob3d_draw_end popmatrix: GL Error: Invalid operation

max v2;
#N vpatcher 309 204 909 604;
#P origin 0 -226;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 127 309 83 196617 jit.window foo;
#P newex 52 70 43 196617 jit.qball;
#P toggle 52 21 15 0;
#P newex 52 47 55 196617 metro 20;
#P newex 52 101 55 196617 t b erase b;
#P newex 52 282 80 196617 jit.gl.render foo;
#P window linecount 7;
#P message 321 103 103 196617 reset , glbegin lines , glenable line_stipple , gllinestipple 1 257 , glvertex 0 0.5 0.5 , glvertex 0.5 0 0.2 , glvertex 0.1 0.5 0.5 , glend;
#P window linecount 1;
#P newex 321 242 93 196617 jit.gl.sketch foo;
#P connect 5 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 3 0;
#P fasten 3 1 2 0 79 137 57 137;
#P connect 3 0 2 0;
#P connect 1 0 0 0;
#P pop;


April 11, 2006 | 8:37 pm

Note that you can’t give arbitrary gl calls between glbegin and
glend. It is a very small subset of calls which are valid within
glbegin/end, mostly restricted to vertex attributes (position,
texture, color, normals, fog coordinate, etc). other opengl calls
such as any glenable/disable calls must happen before the glbegin
call. Changing this, your example seems to work as expected for me.

See the OpenGL Red Book (p.46 in my edition) for more information on
glBegin()/glEnd() restrictions.

-Joshua


April 11, 2006 | 9:28 pm

thanks very much joshua, that worked.

oli


Viewing 3 posts - 1 through 3 (of 3 total)