Results 1 to 7 of 7

Thread: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2005
    Posts
    13

    TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    I am trying to make an object transparent, though I don't really know what to do here. Someone mentioned to me about the alpha level, but I don't know what the standard variable for that is, or where to look on the program I am modifying.

    Also, I was responsible for making the mouse useable on a program that was originally all controlled through the keyboard. The program is for viewing 3D objects. Basically, when the user clicks on the object, he can rotate it. For some reason, the mouse controls act differently with different 3D objects I view with the program. I don't understand why.
    jjcheng

  2. #2
    Guest

    Re: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    I am trying to make an object transparent, though I don't really know what to do here.
    have you read the redbook?

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2005
    Location
    china
    Posts
    1

    Re: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    i think the transparent object can be realized by modifying the transparency of the texture of every faces.

    http://nehe.gamedev.net/data/lessons....asp?lesson=08

    Maybe it can resolve your puzzle.

  4. #4

    Re: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    I enable blending, and with a texture with alpha channel, y use the next blend function

    glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2005
    Posts
    13

    Re: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    I also put this in the init function.

    glColor4ub((GLubyte)(1.0),(GLubyte)(1.0),(GLubyte) (1.0),(GLubyte)(0.5));
    glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

    The original code used glColor3ub, I changed it to 4ub, and gave it an alpha value of 0.5.

    After that, I also added this code below it:

    glEnable(GL_BLEND);
    glDisable(GL_DEPTH_TEST);

    Though, there isn't any change. What am I doing wrong?
    jjcheng

  6. #6
    Guest

    Re: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    glColor4ub((GLubyte)(1.0),(GLubyte)(1.0),(GLubyte) (1.0),(GLubyte)(0.5));
    this function takes unsigned bytes [0,255]. you are passing floats.

    try glColor4ub(255,255,255,12;

    only the floating point flavors take the normalized color components...

  7. #7
    Junior Member Newbie
    Join Date
    Jun 2005
    Posts
    13

    Re: TRANSPARENCY AND MOUSE CONTROL PROBLEMS

    Ah I see. Thanks for the help!
    jjcheng

Similar Threads

  1. NSOpenGLView visual transparency vs. mouse transparency
    By hidefromkgb in forum OpenGL: macOS
    Replies: 1
    Last Post: 05-12-2015, 01:05 PM
  2. Opengl camera control GUI instead of mouse control
    By zhar22 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-17-2013, 09:35 AM
  3. Mouse Control in 3D
    By jjcheng in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 06-17-2005, 11:22 AM
  4. mouse control
    By Grafenberger in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-29-2003, 08:13 AM
  5. Mouse control
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-30-2001, 02:08 PM

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