Search code examples
xnasystemgismonogamecoordinate

Converting from Real world coordinate System to another


I have issue I am tryin to sort.

So basically I have a coordinate system where +x = traveling East, +y is up, and +z is traveling North. Effectively I have taken Lat/Long and projected it to OSGB.

I have a list of points in this coordinate system, but when I render them they are flipped on one axis The Z(North) axis so my point list looks incorrect.This is because the rendering API has the +z axis running the other way.

I was thinking my solution to this could be, have all my objects/3d models/points etc drawn in my "Real World" coordinate system, then at the last moment before I render then apply a Scale Matrix (1,1,-1) to each of the world matrices so that the Z Axis is flipped on everything.

So if my real world projected coordinate is: 281852; 161.488; 655844 After I apply my "RealWorldToXNA" matrix, the point will be 281852; 161.488; -655844;

I will then apply the same thing to my camera so it renders from the correct position.

Will this work or am I missing something? I haven't done a lot of 3d maths lately and have suffered a bout of cerebral flatulence. Part of my brain thinks this will work, but another part thinks it shouldn't be so simple.


Solution

  • FYI I used the solution in my question - just tested it and it did in-fact work as expected.