r/GraphicsProgramming • • Apr 30 '24

Does anyone else use the X axis for depth?

My projection matrix looks towards positive X, the Y axis points to the left and the Z axis points up. It was what felt intuitive to me and became very easy to work with, especially controlling the camera. So far I haven't had any problems with this setup.

2 Upvotes

11 comments sorted by

15

u/Revolutionalredstone Apr 30 '24

Yeah every damn project does it differently :D

I wrote my library to be highly agnostic, it has enums for GL space, DX space, Geo Space, etc and you can easily convert between them.

My library itself has default space (geo space) but that can be changed easily by just selecting a different enum in one place.

Every space has it's value, that said, your space is bad 🤢 and you should feel terrible for making it!🤮

I can see defence for using GL, DX, or Geo but anything else is just causing yourself unneeded problems.

Best luck, Enjoy!

11

u/wrosecrans Apr 30 '24

It's definitely an uncommon convention. But there's no particular reason it's "wrong." Just one matrix transform away from something normal.

10

u/schnautzi Apr 30 '24

I have never seen this in the wild, but there's no law against it.

9

u/Zestyclose-Compote-4 Apr 30 '24

I think people just think of it like you begin with a regular 2D diagram. X and Y. Then we add Z.

6

u/Solrax May 01 '24

Burn the heretic!

1

u/epicalepical May 01 '24

i think this is the convention blender uses (used? i havent used blender in years)

1

u/ukaeh May 03 '24

For me positive x is to the right, positive y is depth and positive z is up :)

1

u/fgennari May 01 '24

I originally used that system for my camera in a project I started long ago. I began with 2D and then added Z for up. You can do whatever you want as long as you can keep the matrix math correct.

-1

u/Abbat0r May 01 '24

This is what Unreal Engine uses

1

u/wm_lex_dev May 01 '24

It uses X-forward Z-up in world space, but I'm pretty certain not for NDC space.

0

u/[deleted] May 01 '24

[deleted]

2

u/Klumaster May 01 '24

This is a different thing though. Aras' post was about using a different feature of the GPU that's less performant, Dixerion's just rearranging a matrix multiplication to put the axes in different places, it'll be identical in terms of operations.