square texture on circle (using gluDisk)

  • Follow


I would like to drape a square texture on a 2D circle (using gluDisk), 
without the textue being distored.

Use case: I have picture of watch as a square picture. Basically a white 
square with a swatch in the middle of it (as a circle). I want the gluDisk 
to carry the texture basically cutting out the white part of the texture.
The OpenGL FAQ (21.140) mentions using fractional texture coordinates, but 
no sample code.

Thanks
Latti

I know I can solve this adding alpha to the picture, but that is not what I 
want to do. 


0
Reply Latti 7/3/2006 8:33:21 PM

This seems to work:

::glEnable(GL_TEXTURE_2D);

::gluQuadricDrawStyle(m_qCircle, GLU_FILL);

::gluQuadricTexture(m_qCircle, GL_TRUE);

::gluDisk(m_qCircle, 0, 200, 50, 10);

::glDisable(GL_TEXTURE_2D);

I found it myself :-)

Latti

"Latti" <latti@pandora.be> wrote in message 
news:lafqg.517410$p7.12812393@phobos.telenet-ops.be...
>I would like to drape a square texture on a 2D circle (using gluDisk), 
>without the textue being distored.
>
> Use case: I have picture of watch as a square picture. Basically a white 
> square with a swatch in the middle of it (as a circle). I want the gluDisk 
> to carry the texture basically cutting out the white part of the texture.
> The OpenGL FAQ (21.140) mentions using fractional texture coordinates, but 
> no sample code.
>
> Thanks
> Latti
>
> I know I can solve this adding alpha to the picture, but that is not what 
> I want to do.
> 


0
Reply Latti 7/3/2006 8:50:01 PM


1 Replies
528 Views

(page loaded in 0.101 seconds)

Similiar Articles:







7/22/2012 1:53:37 AM


Reply: