Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: How do I make texture which is not a rectangular

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Singapore
    Posts
    28

    How do I make texture which is not a rectangular

    Hi all,

    How do I make a texture which is not rectangular? for example it's a circle or an elipse? how do I specify the coordinate of (s,t) of the texture to be map to a rectangular for example?

    Oh ya for more detail.. actualy the texture is rectangle but only part of this texture area I'm interested. This part of texture is in the form of circle or elipse.

    regards,
    songeb

    [This message has been edited by songeb (edited 02-19-2002).]

  2. #2
    Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Turin
    Posts
    269

    Re: How do I make texture which is not a rectangular

    U just need to set the alpha channell for that texture.

    Instead of using RGB textures format use RGBA, and set the Alpha value to 0 for zones you don't want to render.

    For a fast solution try to draw a filled circle, and fill the rest of the picture with a known color, for example pure red (0,255,0), while loading data from your texture do a cicle :

    if (R = 0) and (G = 255) and (B = 0) then
    set alpha = 0

    this way you'll get a transparent texture where original pixelmap was GREEN...

    hope it helps....

    rIO.sK http://www.spinningkids.org/rio
    [rIO^sPINNING kIDS] - rio@nospam.spinningkids.org

    -/- This is a signature virus. Add it to your signature. Help it spreading! -/-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •