# Associate game coordinates and system coordinates

This topic is 3872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How you guys reccomend to associate game coordinates to system(OpenGL) coordinates. On system coordinates character is standing on x:0.0f y:0.0f z:0.0f but in game x:50.0 y:123.0

##### Share on other sites
Use an affine transformation to transform a point in game space to a point in OpenGL space (or between any two spaces really).

An affine transformation is usually represented as a 4x4 matrix, used to transform your position as a 4D vector (ie: your position vector would look like <50, 123, 0, 1>). If you're not comfortable with that sort of thing, you could do essentially the same thing using a translation vector and a rotation/scale matrix. First rotate/scale your point then add the translation vector to arrive at a new point.

If your two systems have the same scale and orientation (so your scale/orientation matrix is an identity matrix), then you would simply add some vector to your point representing the difference between game and OpenGL coordinates.

Most of this is actually handled by OpenGL if you know what to do. When you set up your projection matrix, you can specify a matrix that will handle all of this for you.

Hope that helps.

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 11
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633755
• Total Posts
3013706
×