Name any uses for dot product or cross product in video games
Name any uses for dot product or cross product in video games
The cross product is used to find surface normals of triangles (the building blocks of objects in 3D games). Those surface normals can then be used in dot product tests with the camera to test if the normal is facing the camera or not. If the dot product angle is positive then the normal is facing the same direction as the camera, so the triangle does not need to be drawn (because it cannot be seen). If the angle is negative, then the two vectors are pointing at each other and the triangle may need to be rendered. These methods not only apply to camera viewing, but also to lighting and physics calculations as well.