From: faculaganymede (faculaganymede++at++yahoo.com)
Date: 02/18/2005 14:19:07
pfExperts,
It appears when I use glDrawPixels and pfuSaveImage in
draw callback, there's some conflicts. I get the same
image on all frames - frame n is the same as frame 0
(n=0:infinity);
Below is the DrawChannel callback function. Any idea?
// Draw process callback
static void DrawChannel (pfChannel *chan, void *)
{
int g_width=500;
int g_height=500;
char *intensity_img;
static int frame_num=0;
char fname[256];
intensity_img=new char[500*500];
chan->clear();
pfDraw ();
glReadPixels( 0, 0, g_width, g_height, GL_RED,
GL_UNSIGNED_BYTE, intensity_img);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D( 0.0, g_width, 0.0, g_height);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glDrawPixels( g_width, g_height, GL_RED,
GL_UNSIGNED_BYTE, intensity_img);
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
sprintf(fname, "snap_%d.rgb", frame_num);
pfuSaveImage(fname, 0, 0, g_width, g_height, 0);
frame_num++;
if(intensity_img)
free(intensity_img);
}
=====
Thanks,
faculaganymede
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
This archive was generated by hypermail 2b29 : Fri Feb 18 2005 - 14:19:22 PST