Howto let a GL_QUAD look like an Oval Form?

Started by benowar, November 28, 2005, 15:31:15

Previous topic - Next topic

benowar

Hi,

I use a simple GL_QUADS with a texture which uses an oval shape. Take a look at this shot: http://www.rssowl.org/shot.png

The blue quad in front uses the texture and as you can see, the corners overlap, which makes it look a bit ugly.

Is it somehow possible to let the corners be completly transparent? The texture itself is transparent on the corners. But as soon as I set a Color to the quad, the borders show with that color as well.

Thanks,
Ben

CaseyB

You can use glColor4f() to set the color for the quad.  The first 3 float values are the color and the last is the transparency.  You can set it to be completely transparent.  If you want the semi-transparent look in the center you can make that part of the texture.

benowar

Yes I am already using glColor4f, but I think its not helping in this case. As soon as I set the quad to be completly transparent, the Texture itself is no longer showing. Is there any way to let glColor4f not affect the Texture?

Ben

Fool Running

Some code would help...
Without code; a couple ideas:
Make sure you have the correct texture blending mode set to allow what you are trying to do (sorry, but I don't remember it at the moment :roll: . GL_MODULATE maybe?)
Make sure you have blending enabled (I assume you do since you can see through the texture :lol: )
Make sure you are making the texture with GL_RGBA and not just GL_RGB.
Check the texture load code and make sure you are setting the red, green, blue, and alpha chanels into the right places in the texture data (i.e. make sure it is stored red, then green, then blue, then alpha)

Does the texture work if you just put it on a quad without the glColor4f()?
If your texture has the alpha in it then glColor4f(r, g, b, 1.0f) should do it (That is the way I do it, I think :roll: )...
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

benowar

Hat sich erledigt! Nachdem ich einfach mal ganz genau auf GL11.glEnable(GL11.GL_TEXTURE_2D); aufgepasst habe und nur an den stellen enable wo auch wirklich gebraucht, klappts nun!

Thx,
Ben

CaseyB

Cool!  :D
It's weird that that would cause the trouble you were seeing though!  :?

benowar

Oh sorry for my german  :oops:

I just placed some enable / disable GL11.GL_TEXTURE_2D around my various objects that I render and its working now. I even got some strange problems where showing a texture resulted in other Objects completly getting invisible, but that seems to be fixed now as well.

ben

Fool Running

Quote from: "CaseyB"Cool!  :D
It's weird that that would cause the trouble you were seeing though!  :?
I second the thought!  :wink: That's a really weird thing to do to fix it.  :lol:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D