- C++ Game Development By Example
- Siddharth Shekar
- 480字
- 2021-06-24 14:26:14
3D coordinate system
When we want to specify a location, we have to specify a coordinate system before we specify a point. A 3D coordinate system has three axes: the X axis, Y axis, and Z axis. The three axes start from the origin where the three axes intersect.
The positive X axis starts from the origin and starts moving endlessly in a direction and the negative X axis moves in the opposite direction. The positive Y axis starts from the origin as the X axis and starts going in the upward direction at 90 degrees to the X axis and the negative Y moves in the opposite direction. This describes a 2D XY plane which forms the basis for a 2D coordinate system.
The positive Z axis also starts from the origin as the X and Y axis and is perpendicular in to X and Y axis. The positive Z axis can go in either direction to the XY plane forming a 3D coordinate system.
Assuming the positive X axis is to the right and positive Y axis is to the up direction then the Z axis can either go into or comes out of the screen as the Z axis is perpendicular to both the X and Y axis.
If the positive Z axis moves into the screen, it is called a Left Hand Coordinate System. If the positive Z axis comes out of the screen, then it is called Right Hand Coordinate System.
Open out your right arm with the palm facing towards you and make a fist. Extend the thumb to the right, and extend the index finger upwards. Now extend the middle finger which faces towards you. This is the right hand coordinate system.
The thumb represents the direction of the positive X axis, the index finger represents the direction of the positive Y axis and the middle finger is the direction of the positive Z axis. OpenGL, Vulkan or any graphics framework that use them also use this coordinate system.
For the left-hand coordinate system, extend your left arm out with the palm of the hand facing away from you and make a fist. Next extend the thumb and index finger in the right and upwards direction. Now extend the middle finger away from you. In this case, the thumb also represents the direction of the X axis and the index finger is pointing in the direction of the positive Y axis which faces in the right and upwards direction. The Z axis (which is the middle finger) is now facing away from you. This is the Left Hand Coordinate System. Direct3D of DirectX uses this coordinate system.
In this book, since we are going to be covering OpenGL and Vulkan, we will be using the Right Hand Coordinate System:

- Augmented Reality with Kinect
- 基于Proteus和Keil的C51程序設(shè)計(jì)項(xiàng)目教程(第2版):理論、仿真、實(shí)踐相融合
- 硬件產(chǎn)品經(jīng)理手冊(cè):手把手構(gòu)建智能硬件產(chǎn)品
- 分布式微服務(wù)架構(gòu):原理與實(shí)戰(zhàn)
- 計(jì)算機(jī)組裝與維護(hù)(第3版)
- 筆記本電腦使用、維護(hù)與故障排除從入門(mén)到精通(第5版)
- Building 3D Models with modo 701
- 超大流量分布式系統(tǒng)架構(gòu)解決方案:人人都是架構(gòu)師2.0
- 深入理解序列化與反序列化
- WebGL Hotshot
- 圖解計(jì)算機(jī)組裝與維護(hù)
- 單片微機(jī)原理及應(yīng)用
- 觸摸屏應(yīng)用技術(shù)從入門(mén)到精通
- 單片機(jī)項(xiàng)目設(shè)計(jì)教程
- Practical Artificial Intelligence and Blockchain