Coordinate system/ dynamically placing objects on the map
Posted: Fri Jun 08, 2007 1:19 pm
Consider the following.
I'm loading an XML file containing some (static) world data, for example trees and rocks on certain places.
This produces tiles of which the world is composed (for ease think of a 2d map, so only x en y coordinates exist), so while running the application we see a world in which we can travel.
But, now I would want to add object to the world dynamically, like when i click a certain button and then click a certain spot on the map I want a mesh to be drawn on that position.
Ofcourse I would need to know the x and y coordinates of the point specified.
Here comes the question, what is a good why of getting the coordinates of the point clicked ON the map, should we come up with our own coordinate system, or how should we handle this?
I'm loading an XML file containing some (static) world data, for example trees and rocks on certain places.
This produces tiles of which the world is composed (for ease think of a 2d map, so only x en y coordinates exist), so while running the application we see a world in which we can travel.
But, now I would want to add object to the world dynamically, like when i click a certain button and then click a certain spot on the map I want a mesh to be drawn on that position.
Ofcourse I would need to know the x and y coordinates of the point specified.
Here comes the question, what is a good why of getting the coordinates of the point clicked ON the map, should we come up with our own coordinate system, or how should we handle this?