i am trying to make an animtaion with a text in opengl. Basicaly, i wan’t to draw an image (the text) the erase it, change the position of the texte and redraw ti and so on… at the end the text shoud look like it was moving. the problem i have is that i can’t erase the text and i am lookin how tom do it int opengl but without cleatin background elements.
here the code for the animation
std::string text = "TEST TEXT";
glDisable( GL_DEPTH_TEST );
for(int j = 0; j < 25; j++)
{
//xcord,ycord,zcord are coordinates to give to the function, for the moment
//i use the center of the screen..
glRasterPos3d(--xcord,--ycord,zcord);
for (unsigned int i = 0; i < texte.size(); i++)
{
glutBitmapCharacter( GLUT_BITMAP_HELVETICA_12, texte* );
}
compteur.dormir(1);
glClear(GL_DEPTH_BUFFER_BIT);
//glClear(GL_COLOR_BUFFER_BIT);
}
glEnable( GL_DEPTH_TEST );
can anybody help me or know an easier way to do it?