0

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.

Rufus Mall
  • 569
  • 4
  • 14
  • Seems reasonable to me as a way of doing the transformation, although XNA uses the correct mathematical system, but I guess you may be used to working in the opposing system due to some modelling tools using it. – ManoDestra May 19 '16 at 14:09
  • Try it, see if it works, tell us the results – Monset May 19 '16 at 14:19
  • You don't need to add an artificial matrix. Just create the camera and projection matrices with these assumptions in mind. Both should be left-handed. – Nico Schertler May 19 '16 at 17:25
  • I'm having a hard time wrapping my head around your coordinate system (I'd have thought your Y and Z were swapped but maybe you have some reason for that) wrt what little I understand of [XNA's](http://gamedev.stackexchange.com/a/7006); but it sounds like your approach will work. In the GIS world 0 NS - the equator - is usually halfway between the extremes of the 'Y' - your 'Z' axis. One presumes your use of the Ordnance Survey National Grid won't run into issues of crossing the date line or the equator. – jwd630 May 19 '16 at 21:17
  • Thanks for your help guys, I ended up just trying it out and it works well. – Rufus Mall May 31 '16 at 13:41

1 Answers1

0

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

Rufus Mall
  • 569
  • 4
  • 14