Jason Roelofs wrote:
> Interesting way of doing it, that's for sure, but all you'll need to do 
> is
> treat the string like an array. e.g.:
> 
> pixels = GL.ReadPixels(...)
> 
> pixels[0] # r of first pixel
> pixels[1] # g of first pixel
> pixels[2] # b of first pixel.
> 
> The crazy /000 stuff you see is simply a nice way of displaying 
> characters
> that aren't of the a-zA-Z0-9 character range. As RGB values are 0-255, 
> you
> can save the stuff in a single character.
> 
> So while it's actually a string, just treat the results as an array of
> numbers.
> 
> HTH
> 
> Jason

Thanks so much!  Your reply wasn't exactly what I needed, but it did 
help me realize how stupid I was being.  Here's what I really needed:

winZ=glReadPixels(winX, winY, 1, 1, 
GL_DEPTH_COMPONENT,GL_FLOAT).unpack("f")[0];

Apparently unpack was the function that I needed to convert the string 
representation into the float values that I needed.  I should have 
mentioned that I was trying to find the depth component, but your 
example with the RGB components still helped me find my answer.

Thanks!
-- 
Posted via http://www.ruby-forum.com/.