Archived

This topic is now archived and is closed to further replies.

cwchan

Need help in improving speed when zooming in object

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites