#### Archived

This topic is now archived and is closed to further replies.

# unwanted connected polygons

This topic is 5343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

//////////////// say i do this: glBegin(GL_QUAD_STRIP); glVertex3i(0,0,0); glVertex3i(1,0,0); glVertex3i(0,1,0); glVertex3i(1,1,0); glVertex3i(0,2,0); glVertex3i(1,2,0); glVertex3i(0,3,0); glVertex3i(1,3,0); glVertex3i(0,4,0); glVertex3i(1,4,0); glEnd(); ////////////// and then i do this: glBegin(GL_QUAD_STRIP) glVertex3i(20,0,0); glVertex3i(21,0,0); glVertex3i(20,1,0); glVertex3i(21,1,0); glVertex3i(20,2,0); glVertex3i(21,2,0); glVertex3i(20,3,0); glVertex3i(21,3,0); glVertex3i(20,4,0); glVertex3i(21,4,0); glEnd(); when i run the prog there is a line drawn between the 2 sets of quads. this isnt only with quad_strips. i wrote a function to draw a chessboard (8x8 quads) but it didnt work because it connected all the quads together by a line. how do i stop this? i just want to draw separated shapes: i.e. 1.draw a shape 2. draw another which is in no way connected to the 1st one 3. repeat how do i do this?

##### Share on other sites
My guess is that you aren''t given an adequate number of vertices to finish the last quad, but I''m not sure. That''s the only thing that makes sense though.

##### Share on other sites
nope, i wish it were that simple. check this out:

*********************************************************
class Tile
{
int xpos;
int ypos;

void DrawSelf(int x,int y);
}

void Tile::DrawSelf(int x, int y)
{
glVertex3i(x,y,0);
glVertex3i(x+1,y,0);
glVertex3i(x+1,y+1,0);
glVertex3i(x,y+1,0);
glEnd();
}

// this one i had as a member of a class TileMap, and it had a member Tile grid[8,8]
// just dont feel like writing the class now for this example

void DrawBoard(int x, int y)
{
int tempy=y;

for(i=0;i<7;i++)
{
for(j=0;j<7;j++)
{
grid[i,j].DrawSelf(x,y);
y++;
}
x++;y=tempy;
}

int main()
{
//setup openGL stuff .......

DrawBoard();
}
*********************************************************

now it looks like it will draw 64 quads, 8x8, and it does, BUT there are all these diagonal lines running from the first column to all the rest of them, these lines i need to get rid of!

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632995
• Total Posts
3009773
• ### Who's Online (See full list)

There are no registered users currently online

×