![C++ Game Development By Example](https://wfqqreader-1252317822.image.myqcloud.com/cover/625/36698625/b_36698625.jpg)
Points
After we have defined the coordinate system, we can now specify what a point is. A 3D point is a location in 3D space specified by distance in the X, Y and Z axis from the origin of the coordinate system. It is specified as (X, Y, Z) where X, Y and Z are the distance from the origin. But what is this origin you speak of? Origin is also a point where the 3 axes meet. The origin is at (0, 0, 0), and the location of the origin is specified in the coordinate system, as shown as follows:
![](https://epubservercos.yuewen.com/1079FF/19470379008810206/epubprivate/OEBPS/Images/24d78943-e8dd-48eb-a773-a2392c165752.png?sign=1739275224-BbIdlkiJm5ACe1MdTBmiNHMmkuVVABKe-0-1fdd70a7d9d5059d96c5bb547e0fd913)
For specifying points within a coordinate system, imagine that in each direction, the axis is made of a smaller unit. This unit could be 1 millimeter, 1 centimeter or 1 kilometer, for example, depending upon how much data you have.
If we just look at the X and Y axis, this would look something like the picture as follows:
![](https://epubservercos.yuewen.com/1079FF/19470379008810206/epubprivate/OEBPS/Images/4e412a35-2f94-4a97-8aa1-f05e2a11829c.png?sign=1739275224-73xORU8PKa5xkTriu08YTNn7cnhAVd6q-0-f1390c7bcb49f76bc44bb1b23e612410)
If we look at the X axis, the value 1 and 2 specify the distance along the axis of that point from the origin which is at value 0. So, point 1 in the X axis is at (1,0,0) along the X axis. Similarly, point 1 along the Y -axis is at (0,1,0).
In addition, the location of the red dot will be at (1,1,0) - that is, 1 unit along the X axis and 1 along the Y axis. Since Z is 0 we specify the value of it as 0.
Similarly, points in 3D space are represented as as follows:
![](https://epubservercos.yuewen.com/1079FF/19470379008810206/epubprivate/OEBPS/Images/b540d03f-e43c-427b-aa02-f514e8dd2a51.png?sign=1739275224-xh6EUvJLWKkCSqy4tNRUyO7Bw6se7Ssn-0-e1328d8f64b162d8528593d3392da26a)