Hands On DarkBASIC Pro - Digital Skills
Hands On DarkBASIC Pro - Digital Skills
Hands On DarkBASIC Pro - Digital Skills
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
FIG-30.4<br />
(continued)<br />
Determining the Position of a<br />
Point in 3D Space<br />
FIG-30.5<br />
Each Object has its<br />
Own Local Axes<br />
World Units<br />
Local Axes<br />
-x<br />
3<br />
Measure the point’s<br />
distance out from the<br />
origin-z along the z-axis<br />
-x<br />
+y<br />
-y<br />
We might, for example, state that point p is at the position (8,12,5) meaning that<br />
point p is 8 units along the x-axis, 12 units along the y-axis and 5 units along the<br />
z-axis.<br />
Distances are measured in units. These units have no relationship to real-life<br />
measurements such as centimetres or inches. Instead, objects are constructed in such<br />
a way as to be the correct size relative to other objects. For example, if we make a<br />
human character 6 units high, then a simple house might be 18 to 25 units high. Of<br />
course, if you wish, you can think of 1 unit being the equivalent of a real distance.<br />
The scale you choose will depend on the context; when creating a world with an<br />
ant as the main character, 1 unit might be equivalent to a millimetre, while a truly<br />
interstellar game might make 1 unit equivalent to 1 light year.<br />
Every 3D object we create has its own local axes. These axes are (initially, at least)<br />
aligned to the world axes. FIG-30.5 shows a cuboid and its local axes.<br />
-x<br />
-z<br />
+y<br />
-y<br />
+z<br />
+z<br />
P<br />
Each 3D object<br />
has its own local<br />
axes parallel to the<br />
world axes<br />
<strong>DarkBASIC</strong> <strong>Pro</strong>: 3D - Concepts and Terminology 747<br />
+x<br />
+x