PDA

View Full Version : my motion blur don't work



airseb
05-27-2003, 02:35 AM
i have a black window,
what can i do ? Can you help me ?
this is a part of the code :


void display ()
{


glEnableClientState (GL_VERTEX_ARRAY);
glEnableClientState (GL_NORMAL_ARRAY);

glPolygonMode (GL_FRONT_AND_BACK, GL_FILL) ;

//glScalef (3.0, 3.0, 3.0) ;

int objectCounter ;
const datas *pointerArrayStruct=lecteur->getArrayStruct() ;
const int *pointerNumberTotalOfVertices= lecteur->getNumberTotalOfVertices() ;
int MaximumObject=lecteur->getA() ; //affecte le nombre maximum d'objets

glClear (GL_ACCUM_BUFFER_BIT) ;

for (l=0 ; l<=10 ; l++)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT /*| GL_ACCUM_BUFFER_BIT*/) ;

glRotatef (10.0, 0.0, 1.0, 0.0) ;
for (objectCounter=0 ; objectCounter < MaximumObject ; objectCounter++)
{
glVertexPointer (3, GL_FLOAT, 0, &amp;(pointerArrayStruct[objectCounter].verticesArray[0][0]));
glNormalPointer (GL_FLOAT, 0, &amp;(pointerArrayStruct[objectCounter].normalsArray[0][0]));
glDrawElements (GL_TRIANGLES, pointerNumberTotalOfVertices[objectCounter],
GL_UNSIGNED_INT,&amp;(pointerArrayStruct[objectCounter].numberOfVerticesArray[0][0])) ;
}
glAccum(GL_ACCUM, 1.0);
//glAccum(GL_RETURN, 1.0);
//glutSwapBuffers() ;
}

glAccum(GL_RETURN, 1.0);
glutSwapBuffers() ;

}

void main (int argc, char** argv)
{

lecteur = new ReadAnAse ;
//cout<<"hello"<<endl ;

glutInit (&amp;argc, argv) ;
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_ACCUM) ;
glutInitWindowSize (640, 480) ;
glutInitWindowPosition (250,250) ;
glutCreateWindow (argv [0]) ;

glEnable( GL_DEPTH_TEST );

//glutKeyboardFunc (keyboard) ;
glutReshapeFunc (reshape) ;
glutDisplayFunc (display) ;
glutMainLoop () ;
}

rgpc
05-27-2003, 05:06 AM
If you remove (comment out) the accumulation buffer code, does your scene draw as expected?

Relic
05-27-2003, 08:13 AM
If yes,
- Query how many bits your accumulation buffers has, maybe you pixelformat has none.
- The glAccum(GL_RETURN, value) should normalize the summed colors. In your case value should be 1/11. Your image should have been too bright.
- Does it help if you add a glFinish() before the glAccum(GL_ACCUM, 1.0)? Mustn't be necessary, though.