java - How do I transform all textures to my player position? [LWJGL 2.0] -
i trying create camera effect transforming textures player coordinates. not working want.
this how draw objects:
public static void drawquadtex(texture tex, float x, float y, float width, float height) { tex.bind(); gltranslatef( x -player.getx(), y - player.gety(), 0); glbegin(gl_quads); gltexcoord2f(0, 0); glvertex2f(0, 0); gltexcoord2f(1, 0); glvertex2f(width, 0); gltexcoord2f(1, 1); glvertex2f(width, height); gltexcoord2f(0, 1); glvertex2f(0, height); glend(); glloadidentity(); }
and how draw player texture:
public static void drawquadtexplayer(texture tex, float x, float y, float width, float height) { tex.bind(); gltranslatef(x, y, 0); glbegin(gl_quads); gltexcoord2f(0, 0); glvertex2f(0, 0); gltexcoord2f(1, 0); glvertex2f(width, 0); gltexcoord2f(1, 1); glvertex2f(width, height); gltexcoord2f(0, 1); glvertex2f(0, height); glend(); glloadidentity(); }
i not understand why not working , help. (i using slick textures).
edit problem player moves other objects still not change place.
Comments
Post a Comment