import net.java.games.jogl.*; public class AnimGLEventListener implements GLEventListener { float tri = 0.0f; public void init(GLDrawable drawable) { GL gl = drawable.getGL(); gl.setSwapInterval(0); } public void display(GLDrawable drawable) { GL gl = drawable.getGL(); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); gl.glTranslatef(-0.4f,0.0f,0.0f); gl.glRotatef(tri,0.0f,1.0f,0.0f); gl.glBegin(GL.GL_TRIANGLE_FAN); gl.glColor3f(1.0f,0.0f,0.0f); gl.glVertex3f(-0.2f,0.0f,0.0f); gl.glColor3f(0.0f,1.0f,0.0f); gl.glVertex3f(0.2f,0.0f,0.0f); gl.glColor3f(0.0f,0.0f,1.0f); gl.glVertex3f(0.0f,0.6f,0.0f); gl.glEnd(); gl.glLoadIdentity(); gl.glTranslatef(0.4f,0.0f,0.0f); gl.glRotatef(tri,1.0f,0.0f,0.0f); gl.glBegin(GL.GL_TRIANGLE_FAN); gl.glColor3f(1.0f,0.0f,0.0f); gl.glVertex3f(-0.2f,0.0f,0.0f); gl.glColor3f(0.0f,1.0f,0.0f); gl.glVertex3f(0.2f,0.0f,0.0f); gl.glColor3f(0.0f,0.0f,1.0f); gl.glVertex3f(0.0f,0.6f,0.0f); gl.glEnd(); if(tri < 360.f) tri += 0.5f; else tri = 0.0f; } public void reshape(GLDrawable drawable, int x, int y, int width, int height) { } public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) { } }