I'm making a 2D isometric tiled game using LibGDX. In my Player class, I created a vector2 that I named 'pos' to manage the player position, then I draw my Player with:


Let's say pos = (0,0), then the Player will be rendered at the bottom left corner of my screen.

When I translate the camera, the (0,0) still correspond with the bottom left of my screen, so the pos Vector2 is about my screen, not my map...

What should I do to get a Coordinate System based on the map and not on my screen? I would not prefer using the Sprite Class...

Thank you :)


1 Answer 1


Have a look at model view protection matrix (matrix transformations): http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

This is related to OpenGL, but the operations are similar in any library.

  • \$\begingroup\$ Basically model Is the position I the map...view is the position on the screen...projection is either ortho or persp \$\endgroup\$ Commented Nov 13, 2016 at 7:28
  • 1
    \$\begingroup\$ This is good, however with LibGDX you can do it automaticly by calling >batch.setProjectionMatrix(camera.combined) \$\endgroup\$ Commented Nov 17, 2016 at 11:06
  • \$\begingroup\$ Yeah..it depends in the framework. But the concept was same. Btw I am an openGL guy \$\endgroup\$ Commented Nov 17, 2016 at 11:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .