Now we are finally getting to 3D. Here the object consist of triangles which are rasterized similarly as we rasterized them with the Bresenham algorithm before. In order to define an object, first one needs to define its geometry: vertices and faces.
Task is to construct a cubistic looking chopper (the aircraft, not the motorcycle). In the most simple form it will consist of 3 cuboids: 1 big one for the body and 2 smaller ones for the blades. Those will currently be monochrome, we will see how to calculate some better colors based on the illumination later. For now, just pick a single color for the body and another for the blades.
We will define our own cuboid geometry construction function. A cuboid is just a scaled cube, so our function can return a geometry for a cube and we can scale it afterwards. The cube, however, needs to be made up of triangles. This means that each face of the cube consists of 2 triangles. So in total there are 12 triangle faces. The vertex count for a cube is 8. The cube should be centered at (0, 0, 0), so that the scaling and other transformations would work as intended. Here is an illustration of such a cube:
You may define the vertices in another order. This means that the faces you have, will be made up of other vertices. Keep in mind that the positive rotational direction in our right-handed coordinate system is counter-clockwise. This means that the front face of a triangle is such, where the vertices go in a counter-clockwise order.
For example, if you define a face consisting of ordered vertices: 1, 5, 6, then that face's front side will be pointing outwards from the cube, which is correct.
Task is to create a function that creates such a cube. Then use that function to have a chopper, with 1 cuboid as the body and 2 cuboids as the blades, in the scene. After this make the blades rotate around the y axis at some speed.
Overall the result would look something like:
Feel free to pick your own colors, scale factors and positions for the geometry.
Do make sure the Chopper's origin is somewhere in the middle or bottom of the actual chopper. Otherwise you might find it hard to do the next task.