官术网_书友最值得收藏!

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:

主站蜘蛛池模板: 思南县| 余干县| 永安市| 宜城市| 崇明县| 名山县| 大埔县| 陇南市| 上犹县| 黔西县| 阿尔山市| 祁连县| 南皮县| 通道| 安徽省| 鲁山县| 三穗县| 错那县| 丰顺县| 星子县| 从化市| 芜湖县| 天津市| 婺源县| 肇州县| 祁门县| 沧州市| 聊城市| 新乐市| 英德市| 武夷山市| 苏州市| 社会| 北流市| 灵川县| 隆尧县| 班戈县| 即墨市| 称多县| 建宁县| 广宗县|