my applet is slow

I’d like to ask a few questions, because I’m fairly new to Java and I don’t know if I’m doing everything correctly.
I’m trying to build an applet which is graphics-heavy. By this, I mean I’m loading 6 2048x2048 24 bit png textures on the screen, as well as a 512x512 32 bit tga texture. What I need to do is when I click somewhere on one of my textures, the program zooms in to that spot.
To accomplish that I manipulate the camera using gluLookAt and change the values. I also change the view frustum like:


gl.glMatrixMode(GL.GL_PROJECTION);
          gl.glLoadIdentity();
          gl.glOrtho(-zoomWidth, zoomWidth, -zoomHeight, zoomHeight, -10, 10);
          gl.glMatrixMode(GL.GL_MODELVIEW);
          gl.glLoadIdentity();

Everything was good up to that point. Then I thought, I’d add a smooth animation, so when the user clicks on a spot, the camera and the view frustum gradually “move” to that point. The problem with this approach is that it seems pretty slow. I tried putting a timer to get the FPS like this:


framesPerSecond++;
currentFrameTime = System.currentTimeMillis();

if ((currentFrameTime - previousFrameTime) > 6000) {
    System.out.println("FPS: " + framesPerSecond);
    previousFrameTime = currentFrameTime;
    framesPerSecond = 0;
}

in my display callback. It shows that I get 55 to 60 fps (I’ve got a loaned ATI Radeon 9600 w/ 256MB of memory).
But if I’m getting 55 to 60 fps, why my display is slow? Am I missing something here? Another thing to note is that the fps println comes every 4-5 seconds. Why is that?
I forgot to mention that my applet runs on a thread.
Sorry for the long post, but there seems to be something fundamental that I’m missing here.

It is because you wait for 6 seconds before printing out the fps:

[quote]if ((currentFrameTime - previousFrameTime) > 6000) {
[/quote]
Wich also means your only getting 10 fps.

You’re right about the 6000 value, I don’t know what I was thinking. :-[ I guess I got confused.
Anyway, I tried removing the textures and I still get 10-11 fps. Any ideas why this is happening?
Could it be that I’m not using an Animator class to do the rendering? Instead I use glCanvas.repaint();

Hmm, I nailed down the cause of the problem. Looking at another post here that has, suspiciously similar, problems, I tried commenting out things that I rendered to see if I can get an improvement. And voila! after commenting out a for that produces 1000 gluDisks that I rendered the problem goes away.
The thing is, the disks are needed. Also, when I used gluDisk with C++ I initialized the object once at startup (gluNewQuadric) and deleted once the program was finished (gluDeleteQuadric). I could draw as many objects as I wanted with just one quadric object.
However when I did this in my project I got a nullPointerException and I have to create and delete every disk that I create. Obviously that’s not good.
Though the nullPointerException is weird. I use netBeans and when I run the project through the appletviewer everything is fine. But when I try to run it through a browser, I get the nullPointerExtension in gluDisk. Should I just forget the gluDisks and go with my own impementation?

Yeeaaah baby!!! I just removed the gluDisk and rendered with quads instead of circles and got around 63 fps!
So the problem lies with the implementation of gluDisk from JOGL?

Hi,

How about redenring your disc in a display list.
Won’t it speed up the drawing time?

Hmm, I hadn’t thought of that. Thanks!