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 4 of 4

Thread: textures and surfaces

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    gainesville, fla, usa
    Posts
    17

    textures and surfaces

    Hi,
    I have two surfaces that I would like to texture.The texture, however,
    needs to cover only half of the surface in width but the full height of
    each surface. I am not sure what is the best way to do this. Any help is
    appreciated...

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: textures and surfaces

    the texture coordinates goes from 1.0 to 0.0 for a reason!

    if you want half the width and the full height.

    0.0, 1.0 0.5,1.0

    0.0,0.0 0.5,0.0

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    gainesville, fla, usa
    Posts
    17

    Re: textures and surfaces

    Hi Gorg,
    Thanks for taking the time to respond to my post.
    I don't think I explained my question properly. I have a surface that I
    want to place a texture on. I want the whole texture to be placed over
    just half of the surface (half of the width and the whole height). I am
    not sure if there is an easy way to do this. What I tried already is the
    following. I wrote the equation for the surface, computed new control
    points for a surface that will just cover half of the original surface.
    The problem here is that I can never generate the actual half of the
    surface (unless the surface is flat, which it isn't) because the curves
    are tanget at the end points but only approach the points in between. So,
    If you can think of an easier way of doing this I would really appreciate
    the help.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: textures and surfaces

    ho! ok, sorry, I misread the question.

    What you could do, is create a texture with an alpha channel. Make the first half of the texture your real textures and set the alpha to 255. And for the other part, use an alpha of 0.

    The blending equation you will have to use is:
    gl_src_alpha, gl_one_minus_src_alpha

    do normal texturing with the coordinates from 0.0 to 1.0

    [This message has been edited by Gorg (edited 03-28-2000).]

    [This message has been edited by Gorg (edited 03-28-2000).]

Posting Permissions

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