Advertisement

Speed problems

Started by October 23, 2003 03:56 PM
1 comment, last by Sord 21 years, 4 months ago
Hello, I''m trying to get through the tutorials, however everything goes so extremely fast. For example the textured box in example 7, if I even tap left then its spinning extremely fast. Or in the previous ones like the cube moving around the triangle, I have to add an extra 0 after the decimal for it to look right where it changes the rotation. How can I implement something to change rotations based on speed or something? For example if I make a 3d world like NeHe World how do I make it so hitting up doesnt take me to the other end of the world whereas its correct on slower computers? Thanks Comp Specs: Dual 2.4GHz P4 1GB RAM 128MB ATI Radeon 9800 Pro etc.
Well you have v-sync off in your open gl settings in the properties of your video card. Its recomended you turn them on as a default (not always on) so nehe demos don''t blaze on your computer.

For time based momvemnt I base movement on a average frame render time (I call it speedadj). When ever i mutiply or move somthing i mutiply it by that factor(speedadj). You can get the time it takes to render each frame by using a clock call and compairing the time of the current frame to that of the last frame.

I smooth the factor over 4 frames to avoid any "jumps" if a frame rate is dramaticly increased or decresed.
Advertisement
Thank a lot for the timely response! Enabling v-sync to always on fixed the problem. I''ll look into adjusting speeds later when I get into actually useful programs now that I don''t have to worry about doing it myself.

This topic is closed to new replies.

Advertisement