Strange looking triangles

I’m having troubles when drawing small triangles in a scene. They triangles doesn’t look good, they look crooked even though the coordinates specifies a straight triangle.

What can be wrong? And how can I fix it?

I wonder if setting glMatrixMode to GL_PROJECTION may cause the problem?

I guess this is quite elementary but I would really appreciate any help.

Thanks in advance.

You should post the code, we cannot help you if we do not know what you have done.

do post code
…but yes not setting up a proper projection or modelview matrix would result in this behavior.

This is what I do before i draw the triangles

glClearColor(0.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(0.0,WIDTH,0.0,HEIGHT,1,1.5);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glTranslatef(0,0,-1.0010);

// draw triangles

WIDTH and HEIGHT variables are set to the width and height of the window. When I change the size of the window the appearance of the triangles change.

glFrustum( -(WIDTH/2.0), WIDTH/2.0, -(HEIGHT/2.0), HEIGHT/2.0, near, far);

And you might want to use lower/higher values for the clipping planes to make sure you don’t clip the triangles.

Mikael