Search code examples
.net3dxnaorientationaxes

What is the most universal axis orientation in a 3D world?


I'm creating a .NET library which generates data for a 3D world, but it doesn't do any of the rendering itself. It falls on XNA, DirectX, OpenGL, etc to render it based on the data (the end coder does this). I want to provide the world data in a format which makes the most sense. In XNA, "Z" goes into-the-screen, "X" goes left-right, and "Y" goes up-down (based on my testing). I can deliver the world data in this same format, but I don't want to have it dependent on XNA. Is this the most common format for the axes orientation? I always visualize things as being "Z" as up-down and "Y" being into-the-screen, so I was going to deliver the world data in this format and just convert it in my XNA bootstrapper, but if no one else uses the data w/ that orientation, then it seems silly to deliver it like that.

Very grateful for any advice. Thank you.

Also, the world data is basically terrain data, so it has a logical structure for what should be up and down - mountains, etc.


Solution

  • Yes, in video game programming, because DirectX was the most popular 3D library for a while, the left hand X to the right, Y to the top, Z forward was and is still the most common axis convention used.

    However, be aware that XNA math classes have all switched to a right hand convention, so if you want to work in a left handed system, you will have to invert some results, such as cross products.