Author Topic:   delays and effects.
posted January 20, 2000 11:45 PM            
I was wondering what do you think is the best way to make things slow down?
I have created my skybox in my engine very similar to q3 when you look at the sky but the thing is everything goes so damn fast. I have tried using the Sleep(30) and that puts a delay on everything so my whole system seems to slow down. Is there any way i can specify a delay with the texture cords while still the rest off the game does not have to slow down. I seem to be having this problem a lot of places inluding my weapons effects. Is the only way I can fix this is with multithreading? I would greatly appreciate it if someone could help me.
btw-> for my special effects am i supposed to
glPushMatrix() and when i am done specfying the model and incrementing it the right amount do my effects code and then pop of the stack? or just work off what my matrix is currently positioned at?
I saw in treadmarks that you made that really cool rocket launcher weapon, is there any way you could tell us the way you set up your intial cordinates? like did you push the matrix on the stack have a loop for your particles, start particle effects accordingly with the loop, glTranslatef(0.0, 0.0, amount) for the actual location then pop off the stack?
thanks again.
akbar A.

btw-> i know for the glTranslatef call your x axis and y would obviously have some deviation routines cause they just don't go down the z-axis. I just shortned it up above for readabilty sake.


posted January 21, 2000 09:33 AM            
loop for each frame:
if(getTime() - lastTime > delayTime)
lastTime = getTime();

process rest of the frame
end loop

Hope that clears the idea. Ask for more if needed. This isn't of course the only way to do timing.


posted January 21, 2000 03:36 PM            
The Right Way (TM) to do it (IMHO) is like this:
DWORD dwTime = timeGetTime();
float fLastFrame = (dwTime - dwLastFrame) / 1000.0f;
dwLastFrame = dwTime;

the movement of skybox (and of everything else) before the next frame should be proportional to the value of fLastFrame; this way you'll get the same perceptual movement on different machines. (hopefully)