Problem with triangles intersection with alpha.

Hello!

I would like to draw triangles (with the same Y - up direction - value), which ones may intersect each other. When I draw it with alpha value, I see darker blobs.
How can I resolve it?
screenshot:: http://delfin.unideb.hu/~fazekaim/problem.jpg

I have a plane quad (in red colors), and above the quad a lot of randomly generated triangles with the same Y(up direction) value.

Thanks.

You enabed blending with gl.glEnable(GL_BLEND) ?
If so, you could alter the blend function so it’s not additive. Some call to gl.glBlendFunc(…, …)

(I’m not sure, I’m quoting from memory. Maybe I’m misunderstanding your problem.)

I’m using this:

gl.glEnable(GL.GL_BLEND);
gl.glColor4f( 0.0f, 0.0f, 0.0f, 0.3f );
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);

Should I use other blend funt.?

Yes.
In case you don’t want to alpha-sum at all, you could just disable blending (which is the default).
What behaviour should your lines have, when they’re drawn?

But, if the blending isn’t enabled, the triangles arn’t transparent.
I would like to draw the triangles with 0.3 alpha value without the additive effect.
Or may I’m wrong?

If you try to overlap many polygons with the same depth you will have to use GL_POLYGON_OFFSET i think.