[ODE] Pixel Map from drawstuff window

Koby Zalmanson zkoby at inter.net.il
Mon Sep 22 22:14:35 MST 2003


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(:


char* pixels;

  if (NULL==(pixels=new char[WIDTH * HEIGHT * 3]))
}
      fprintf(stderr,"No more memory. C_DOG::getBitMap()\n");
      exit(-1);
}
 
glReadPixels(0,HEIGHT,WIDTH,HEIGHT,GL_COLOR_INDEX,GL_UNSIGNED_BYTE,pixel
s);  glPixelStorei(GL_PACK_ALIGNMENT, 4);
  glPixelStorei(GL_PACK_ROW_LENGTH, 0);
  glPixelStorei(GL_PACK_SKIP_ROWS, 0);
  glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
  //Those lines should set OpenGL up for PCM reading.
  bzero(pixels,WIDTH * HEIGHT * 3);

  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



More information about the ODE mailing list