[ODE] Pixel Map from drawstuff window

Michael Lacher michael.lacher at hlw.co.at
Tue Sep 23 10:28:35 MST 2003


Koby Zalmanson wrote:
> First of all we appologise because this question is not directly about
> ODE.
> WE are trying to make a simulation of the Son'y AIBO dog, using ODE.
> One of the dog's abilities is to capture a picture.
> In our simulation we succedded to create the dog and now we try to
> capture an image of the drawstuff window into a pixel map without much
> success. 
> We have used the follwing command (by the help of someone in ODE's
> mailing list(:
> 
[snip]
> 
>   glReadPixels(0,HEIGHT,WIDTH,HEIGHT, GL_RGB,GL_UNSIGNED_BYTE, pixels)
> We have only one question about it:
> In which format does it save it?
> meaning, from left bottom, or right bottom?
> in which order does the colors: red,green blue are saved in a
> pixell into the array?
> Thank You
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 

I am not sure, if the back buffer has the pixels in any defined order. 
If it has, you will surely find the information you need in the OpenGL 
specification (look at http://www.opengl.org). But I rather suggest 
using render-to-texture funcionality (also called pixel buffers in 
opengl) to achieve this. With render-to-texture you can render your 
openGL scene to an image of arbitrary size (independent of window size) 
and you do not have to care about things like pixel ownership, etc ... 
you can even use different camera settings (like the dogs perspective, 
without having to upset the viewers screen).

mucki




More information about the ODE mailing list