PDA

View Full Version : Is my computer color blind ?



waldoo
03-06-2002, 09:09 PM
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

http://www.opengl.org/discussion_boards/ubb/smile.gif
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)

witcomb
03-07-2002, 02:39 PM
You have the mouse position correct, right? OpenGL uses lower-left opposed to the upper-right that windows would use.

Neil Witcomb

waldoo
03-07-2002, 11:34 PM
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

Bob
03-08-2002, 12:35 AM
(WindowsHeight - Yposition)

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

waldoo
03-08-2002, 01:45 AM
ok thank you but it still does solve with mismatching color. Color palette still show darker than the color in glwindow.

Waldoo

LordKronos
03-08-2002, 07:51 AM
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.

waldoo
03-08-2002, 10:49 AM
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).]

V-man
03-08-2002, 07:05 PM
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

waldoo
03-08-2002, 11:26 PM
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