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

Thread: Is my computer color blind ?

  1. #1
    Intern Newbie
    Join Date
    Jan 2002
    Location
    sacramento, CA
    Posts
    48

    Is my computer color blind ?

    I got dilther solved and now I have problem with color matching. Returned RGB value to my color palette did not match the color in glwindow. Is there some number leaked causing my computer color blind?
    Here is a copy below of color picking function for Visual Basic. I hope you will help solve it and cure my computer's sighting. LOL


    Waldoo


    Private Red As Byte
    Private Green As Byte
    Private Blue As Byte

    Public mousexpos As String
    Public mouseypos As String
    Option Explicit

    Public Function DrawGLScene() As Boolean

    glReadPixels mousexpos, mouseypos, 1, 1, rpRed, pxlByte, Red
    Form2.Text1(4).Text = Red
    glReadPixels mousexpos, mouseypos, 1, 1, rpGreen, pxlByte, Green
    Form2.Text1(5).Text = Green
    glReadPixels mousexpos, mouseypos, 1, 1, rpBlue, pxlByte, Blue
    Form2.Text1(6).Text = Blue

    form1.Picture1.BackColor = RGB(Red, Green, Blue)

  2. #2
    Intern Contributor
    Join Date
    Jul 2000
    Posts
    78

    Re: Is my computer color blind ?

    You have the mouse position correct, right? OpenGL uses lower-left opposed to the upper-right that windows would use.

    Neil Witcomb

  3. #3
    Intern Newbie
    Join Date
    Jan 2002
    Location
    sacramento, CA
    Posts
    48

    Re: Is my computer color blind ?

    Ya I got it figured out. It was Xposition, (WindowsHeight - Yposition) for the coordinate with windows mouse and glReadPxel.

    But the color palette show little darker than the color in glwindow. Do you have any idea why it happened?

    Waldoo

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Is my computer color blind ?

    (WindowsHeight - Yposition)
    Nah, but (WindowsHeight - Yposition - 1) to be correct.

  5. #5
    Intern Newbie
    Join Date
    Jan 2002
    Location
    sacramento, CA
    Posts
    48

    Re: Is my computer color blind ?

    ok thank you but it still does solve with mismatching color. Color palette still show darker than the color in glwindow.

    Waldoo

  6. #6
    Member Regular Contributor
    Join Date
    May 2000
    Posts
    454

    Re: Is my computer color blind ?

    You said you solved the dithering. Did you do so by going to 32bit color? If not (ie: you are still in 16 bit), then you should expect a slight color difference.
    Ron Frazier

  7. #7
    Intern Newbie
    Join Date
    Jan 2002
    Location
    sacramento, CA
    Posts
    48

    Re: Is my computer color blind ?

    I am in 32 bit and it doesnt make any difference. How do you get pixel color from texture map directly without glReadPixel?

    Waldoo

    [This message has been edited by waldoo (edited 03-08-2002).]

  8. #8
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Is my computer color blind ?

    Originally posted by waldoo:
    I am in 32 bit and it doesnt make any difference. How do you get pixel color from texture map directly without glReadPixel?

    Waldoo

    [This message has been edited by waldoo (edited 03-08-2002).]

    There is glGetTexImage but dont know if glGetTexSubImage is available. Besides, the smart thing would be to read it off your own buffer.

    V-man
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  9. #9
    Intern Newbie
    Join Date
    Jan 2002
    Location
    sacramento, CA
    Posts
    48

    Re: Is my computer color blind ?

    Nevermind about it. I just found what the problem was. Its unsigned that VB isnt compatible with. I read some website about it so theres solution for it. If you know please post code here it will help me alot.

    Waldoo

Posting Permissions

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