I use the glOrtho() or glScaled() to accomplish the function of zoom, when zoom out a certain extent, the change of the graphics become slowly .why? and how can I solve it?
You say “when zoomed out” rendering gets slow.
Maybe that’s not what you meant, but if it is, maybe it’s because you’re rendering a lot of stuff and your card is fill-rate limited?
Or maybe you’re not using mipmaps for your textures?
Some things you can do to speed up rendering of lots of small things:
- Render your objects front to back. (use qsort to sort the objects based on distance from the camera)
- Use mipmaps for your textures.
- use lower levels of detail on objects that are further away (or, as in your situation, are drawn smaller).
Scale is linear, and remember the “d” in glScaled just means use ints.
You probably need to scale your scale if you know what I mean. i.e. your scale value should be some log of your zoom factor.
One way to do this is to multiply a scale value by a fixed ammount. So zooming out I’d multiply a fixed scale value by 0.5 and apply it. I could zoom in by multiplying by 2. This would always give a similar rate in the change in the magnitude of your scale and be more like what you expect to see.
Make sure you’re applying scale on your modelview matrix and make sure that you’re using a floating point glScalef.
Ahh, reading the other reply I now realized that you might be talking about frame rate, certainly this could be caused bt the texture filtering mentioned by T101, I just assumed you meant rate of motion rather than frame rate.