Introduction to 3D
One of the strengths of Godot is its ability to handle both 2D and 3D games. Much of what you’ve learned earlier in this book will apply equally well in 3D – nodes, scenes, signals, etc. But changing from 2D to 3D also brings with it a whole new layer of complexity and capabilities. First, you’ll find that there are some additional features available in the 3D editor window, and it’s a good idea to familiarize yourself with how to navigate.
Orienting in 3D space
Open a new project and click on the 3D button at the top of the editor window to see the 3D project view:
Figure 5.1: The 3D workspace
The first things you should notice are the three colored lines in the center. These are the x
(red), y
(green), and z
(blue) axes. The point where they meet is the origin, with coordinates of (0,
0, 0)
.
3D coordinates
Just as you used Vector2(x, y)
to indicate a position in 2D space, you’ll use Vector3...