Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my Game I'm currently have "Scene Coordinates" which are the X,Y coordinates relative to a Game Scene.

In that Scene there are Game Entities, let's say there's a GameEntity A in x=100.0, y=100.0 ( scene coordinates )

Which is the best way to have "Entity Coordinates" so that from GameEntity A point of view, he's standing at x=0.0, y=0.0 with OpenGL transformations?

In that way if I apply something like

glRotatef(angle, 0, 0, 1) 

The entity will rotate around it's own origin and not the scene "global" origin.

share|improve this question
up vote 4 down vote accepted

The order of transformations in OpenGL is the opposite order than for DirectX. For DirectX its the SRT-Rule: Scale, Rotate, Translate - for OpenGL its: Translate, Rotate, Scale

    // move entity to its position
    // rotate entity around its origin
    // drawn entity

DrawEntity must render the entity using its local space coordsystem, they are fixed if there is no animation.

If that doesnt answer your question, please rephrase it and elaborate.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.