Results 1 to 3 of 3

Thread: Drawing a line on top of a texture image

  1. #1
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    16

    Drawing a line on top of a texture image

    I have created a texture image that is loaded onto a polygon. What I would like to do next is draw a rectangle on top of the texture image and make the rectangle translucent. What would be the best way to go about doing this?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Drawing a line on top of a texture image

    Draw textured polygon as usual.
    Enable blending, set colors to RGBA with Alpha around 0.5, (disable depth test or move the rectangle toward the camera), and draw the rectangle.
    Don't forget to re-enable depth test and disable blending before drawing the textured polygon again.

    For reference, read this :
    http://www.opengl.org/resources/faq/...ansparency.htm

    and this :
    http://www.opengl.org/wiki/index.php/Alpha_Blending

  3. #3
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    16

    Re: Drawing a line on top of a texture image

    Thank you for your help, I was able to get it to work

Similar Threads

  1. What's faster drawing line with GL_LINES or Texture?
    By AlexeyZ in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-30-2012, 01:11 AM
  2. Drawing line on texture
    By cjr in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-12-2003, 01:21 AM
  3. problem in drawing a texture image(monochrome image)
    By philm in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-07-2003, 10:45 AM
  4. problem in drawing a texture image ( monochrome image)
    By philm in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-07-2003, 09:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean