Modifying the code to be time based rather than frame based

Depending on your computer, the model in the scene might be moving quite fast or quite slow or just at the right speed. The reason for the different speeds at which the model might move is that, in our code, we move the model 0.1 units on the z-axis before a new frame is rendered every time. A new computer might be able to render the scene with 100 frames per second; this would move the model 10 units per second. When using an old computer, we could have 30 frames per seconds, then the model would only move 3 units. This is only one third, as compared to the new computers. Normally, we want our application to be consistent across different platforms and capabilities so that it will run at the same speed. This can be easily achieved with Ogre.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.37.147