Cross Product
Prereq: Determinant
Input: 2 Vectors
Output: 1 Vector
P is the vector perpendicular to the parallelogram
Use the hand rule to determine which way the perpendicular vector points. The thumb is where it points. (positive, in this case)
Be aware that different dcc packages and games use different left hand or right hand rules
Order Matters
Technical artists may use the cross product for various purposes in computer graphics and game development. Here are some common scenarios where the cross product is used:
-
Normal Calculation: In 3D modeling and rendering, technical artists often need to calculate surface normals for polygons. The cross product of two edge vectors of a polygon can be used to calculate the normal vector perpendicular to the polygon's surface.
-
Tangent and Bitangent Calculation: Technical artists may use the cross product to calculate tangent and bitangent vectors for texture mapping, normal mapping, or other shading effects. Tangent and bitangent vectors are often used in tangent space calculations to transform textures and normals from object space to world space.
-
Rotation: Technical artists may use the cross product to calculate the rotation axis when rotating objects or transforming vectors in 3D space. By taking the cross product of two vectors, they can determine a perpendicular axis around which to rotate an object.
-
Bounding Box Calculation: The cross product can be used to calculate the surface normals of bounding box faces. This information is useful for various purposes, such as collision detection, ray tracing, and rendering optimizations.
-
UV Mapping: In UV mapping, the cross product can be used to calculate the surface area of triangles in 3D space. This information is used to map textures onto 3D models accurately.
-
Procedural Modeling: Technical artists may use the cross product to generate procedural geometry or deform existing geometry based on certain rules or parameters. For example, they may use the cross product to create patterns, twists, or deformations in meshes.
-
Collision Detection: The cross product can be used in collision detection algorithms to determine if two objects intersect or if a point lies inside a polygonal mesh. It can help calculate surface normals and determine the orientation of objects relative to each other.
Overall, the cross product is a versatile mathematical operation that finds numerous applications in computer graphics and game development, making it a valuable tool for technical artists working in these fields.
No Comments