Need help in improving speed when zooming in object

Started by
1 comment, last by cwchan 22 years, 5 months ago
I am currently designing a rotating cube using Win32 console application and VC++6.0. When zooming in the cube, I found that the rotation speed decreased. This issue does not apply when the cube is small (zooming out). Is there any method that can improve the speed? Thanks and hope to hear from you ASAP.
Advertisement
Well your spinning cube uses very little vertices and transformations, so it is probably fill-rate limited. Zooming in on the cube means drawing more pixels and thus using more of your fill-rate. The only way to speed it up AFAIK is buying a better videocard or not drawing as many pixels.

However you can make the cube spin at the same speed no matter how many pixels are drawn. You''ll need to use a timer of some sort like timeGetTime or something similar. What you do, is measure how much time elapsed since last frame. (let''s call it delta_time) Now instead of this piece of C/C++ code:
rotation_angle += rotation_speed;
You use this:
rotation_angle += rotation_speed*delta_time;
This way the cube will always rotate at the same speed, regardless of how many frames are rendered per second.

Dirk =[Scarab]= Gerrits
Dirk =[Scarab]= Gerrits
Looks like I found a solution.

I am using GeForce 2 64MB so I think the fill rate should not be a problem.

What I did is to disable the OpenGL VSYNC, and voila~ frame rate increase a lot.

This topic is closed to new replies.

Advertisement