Beauty of the Dot Product
How does this boring, flat circle become a fully three-dimensional sphere? Well, there isn't a short answer to that question, but a lot of it has to do with mathematics. In particular, the magical thing that gives you the illusion of depth is the dot product . What is the dot product, you ask? Well, first, let's get a little bit of background knowledge. You can define any point in 3D space in terms of its X, Y, and Z coordinates . For example, let's say we have a point P, and we want it to exist in the center of the scene, or the 'origin'. We could look at its position as the vector : 0.0, 0.0, 0.0 We can use this general X,Y,Z format to do more than define positions in space. We can also use this to represent directions , which are extremely important in computer graphics. A normal in computer graphics is simply a vector that tells us which direction a surface is facing. Let's say we have an infinite plane A at our point P we estab...