PDA

View Full Version : (orthographic) jittering using accumulation buffer? please



JOSE ML
11-04-2001, 10:05 AM
My problem is : how do i use the accumulation buffer to jitter the image on my viewport using orthographic projection?
ive made this :
void Normal_auto () {
int jitter;
GLfloat xoff = 50;
GLfloat yoff = 50;
GLint viewport[4];
GLfloat ortho[16];
GLfloat scalex, scaley;

glGetIntegerv(GL_VIEWPORT, viewport);
glGetFloatv(GL_PROJECTION_MATRIX, ortho);

for(jitter=0;jitter<8;jitter++) {

scalex = (2.f/ortho[0])/viewport[2];
scaley = (2.f/ortho[5])/viewport[3];
glTranslatef(xoff * scalex, yoff * scaley, 0.f);

glBegin (GL_POLYGON);
glVertex2f (100,100);
glVertex2f (200,100);
glVertex2f (200,200);
glVertex2f (100,200);
glEnd();
}
glFlush();
}
but it does not use the accumulation buffer to jitter the image, how should i change this? Thanks, Josť ML