prich
03-13-2010, 02:52 AM
Hello there,
i have a problem with moving textures in OpenGL (using LWJGL).
In my app the character moves on the ground to the next tile.
the distance for X is computed like this:
float movex = 100f * time; //where time is the time per frame
When i move like this, the whole tile map start to flicker (in particular textures with a black border).
This happens because the time is not constant every frame (time = 0.01 frame 1, time = 0.0003f frame 2, ...)
If i move like this:
float movex = 100f; //no time is taken
the world and the char move smoothly to the next tile.
My question is:
How do I have to compute the time that:
the drawn tiles do not start flicker/shake the time to run from tile a to tile b is equal on every pc on this world
i have a problem with moving textures in OpenGL (using LWJGL).
In my app the character moves on the ground to the next tile.
the distance for X is computed like this:
float movex = 100f * time; //where time is the time per frame
When i move like this, the whole tile map start to flicker (in particular textures with a black border).
This happens because the time is not constant every frame (time = 0.01 frame 1, time = 0.0003f frame 2, ...)
If i move like this:
float movex = 100f; //no time is taken
the world and the char move smoothly to the next tile.
My question is:
How do I have to compute the time that:
the drawn tiles do not start flicker/shake the time to run from tile a to tile b is equal on every pc on this world