Similar to the example project we used to draw to the objects. I've created example program to learn the basics that are in 3D graphics practically. The example, Graham Josef 3D cube. In this program, we use some elements we used in the last program, such as paints and affine transformation. Let me take you through it now. When you open the project, you will notice that in addition to the main activity, and in my view of class, a new coordinate class is defined. So click on the coordinate file in the Android Studio, you see the source code. You can see that I use this coordinate class to represent a 3D homogeneous coordinates. We have x y z and w. They mainly consists of the constructor and a normalization function. Much like with a 2D homogeneous coordinate, fitting homogeneous coordinate is just a 3D coordinate with an addition dimension called w. W should have a value of one. I'll cover this in more details later. The normalization functions normalize the coordinates by dividing it with W, and setting a W to one. In the MyView class, similar to the 2D graphics example, I create a red paint object and two arrays of coordinates for storing the vertexes of a 3D cube; one for storing the original coordinates, and the other for joining the vertexes on a screen. In the constructor, I first define the red Paint object, and I then define the vertexes of the cube located at origin 000 with size two by two by two. To Java cube, I have to first translate the object by 2, 2 and 2, and then scale the object by 40,40,40 in x y and z directions. To join a cube, I have defined the draw cube and draw line pairs functions. The draw line pairs functions simply uses the canvas to draw a line between two coordinates. The draw cube function draws a 3D cube by calling the draw line pairs function to draw the lines connecting the vertices of the cube. The draw cube function is called an OnDraw function. To enabled translation and scaling, I'll define a function called transformation, which takes a vertex and a matrix as inputs and perform the multiplications, and then output the transformed coordinates. Identifying another function also called transformation to transform an array of vertices. For initializations, I'll define a function called get identity matrix, which will create a four by four identity matrix. The translation and scale functions identified it by setting the parameters of a matrix, then calling the transformation function to translate or scale the vertexes. What do you think we will see when you run this program? When you run the program, you only see a red square instead of a cube, is shown on the screen. Although if the program is designed to draw freely cube, we are viewing the cube directly in front of it. So we cannot see it's depth or any of its 3D feature. In the next lecture, I'll talk you through 3D alpine transformation to adjust this.