How do I draw the same polygon in two different viewports?
I have defined two viewports in my reshape() method but my polygon only appears in the right one.
So how do I do to make the polygon to also appear on the left viewport?
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
GL gl = drawable.getGL();
gl.glViewport (0, 0, width/2, height);
gl.glMatrixMode (GL.GL_PROJECTION);
gl.glLoadIdentity ();
glu.gluPerspective(60.0f, 3.0f, 1.5f, 20.0f);
gl.glMatrixMode (GL.GL_MODELVIEW);
gl.glMultMatrixf(new float[]{4.1f, 4.1f, 6.1f}, 0);
gl.glViewport (width/2, 0, width/2, height);
gl.glMatrixMode (GL.GL_PROJECTION);
gl.glLoadIdentity ();
glu.gluPerspective(60.0f, 3.0f, 1.5f, 20.0f);
gl.glMatrixMode (GL.GL_MODELVIEW);
gl.glMultMatrixf(new float[]{4.1f, 4.1f, 6.1f}, 0);
}