PDA

View Full Version : Breaks appearing while using GL_LINE_STRIP



harshavardhan
09-24-2008, 02:30 AM
hi all......

am using GL_LINE_STRIP for rendering a linear curve like structure..

but at certain points...

the vertices remain unconnected....

some breaks appear...

wat might be the reason for that??

help needed.. pls..

ZbuffeR
09-24-2008, 05:25 AM
Depth testing ? Multisampling/FSAA ?

harshavardhan
09-24-2008, 05:44 AM
nope...

i have not used anything..

am just using vertex and color arrays alone.....

zed
09-24-2008, 02:33 PM
Post a screenshot

I assume LINE_STIPPLE isnt set

u will get messy 'corners' with opengl lines because of the way its implemented, if u want lines that dont 'break' at the corner you will need to draw the lines yourself + add an extra triangle at the corner

harshavardhan
09-25-2008, 03:26 AM
hi i have posted the screenshot showing the mysterious breaks..

btw.. am using OGL ES 1.0 Vincent implementation...

following shows my code snippet...



GLubyte colorArray1[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
GLfloat vertexArray1[] = { 75.0,0.0, 80.0,40.0, 85.0,50.0, 95.0,66.0, 100.0,91.0, 102.5,93.5, 112.5,98.5 };

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);

glColorPointer(4,GL_UNSIGNED_BYTE, 0, colorArray1);
glVertexPointer(2, GL_FLOAT, 0, vertexArray1 );

glShadeModel(GL_FLAT);

glDrawArrays(GL_LINE_STRIP,0,7);



http://img516.imageshack.us/img516/2535/breaks2ij6.th.jpg (http://img516.imageshack.us/my.php?image=breaks2ij6.jpg)http://img516.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)


tanx in advance...

ZbuffeR
09-25-2008, 05:03 AM
Ha !
"btw.. am using OGL ES 1.0 <out of the blue> Vincent implementation..."

Try first on straight GL to verify your code works.

Then can have a look at their source code, and fix it/ or file them a bug.

harshavardhan
09-29-2008, 09:30 PM
hi..

it seems there was an implementation bug in GL_LINE_STRIP...
so..
can u give me a suggestion then..
like... am now involved in developin a map rendering software... for smartphones...
am just using VS 2005 platform...
and for graphics.. this OpenGL ES 1.0... vincent implementation...

the primary graphics involved majorly would just consist of lines, texts and curves... alone..
(ofcourse with colors..)
but i have only three months of time...
so.. which one of the OGLES or OGL version would be better... for me to develop my software??

tanx in advance...

ZbuffeR
09-30-2008, 08:51 AM
developin a map rendering software... for smartphones
Then find a smartphone dev kit.
If you develop on anything different than your target hardware, you can have subtle differences in implementation.