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
Private Red As Byte
Private Green As Byte
Private Blue As Byte
Public mousexpos As String
Public mouseypos As String
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)
You have the mouse position correct, right? OpenGL uses lower-left opposed to the upper-right that windows would use.
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?
(WindowsHeight - Yposition)
Nah, but (WindowsHeight - Yposition - 1) to be correct.
ok thank you but it still does solve with mismatching color. Color palette still show darker than the color in glwindow.
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.
I am in 32 bit and it doesnt make any difference. How do you get pixel color from texture map directly without glReadPixel?
[This message has been edited by waldoo (edited 03-08-2002).]
Originally posted by waldoo:
[b]I am in 32 bit and it doesnt make any difference. How do you get pixel color from texture map directly without glReadPixel?
[This message has been edited by waldoo (edited 03-08-2002).][/b]
There is glGetTexImage but dont know if glGetTexSubImage is available. Besides, the smart thing would be to read it off your own buffer.
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.