vectorCrossProduct: Difference between revisions
BrettMayson (talk | contribs) mNo edit summary |
BrettMayson (talk | contribs) mNo edit summary |
||
| Line 11: | Line 11: | ||
|s1= vector1 [[vectorCrossProduct]] vector2 | |s1= vector1 [[vectorCrossProduct]] vector2 | ||
|p1= vector1: [[ | |p1= vector1: [[Vector3D]] or [[Vector2D]] - since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided | ||
|p2= vector2: [[ | |p2= vector2: [[Vector3D]] or [[Vector2D]] - since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided | ||
|r1= [[Array]] - vector [x, y, z] | |r1= [[Array]] - vector [x, y, z] | ||
Latest revision as of 09:56, 4 April 2026
Description
- Description:
- Cross product of two 3D vectors.
In layman's terms, if you have a polygon (surface) defined by 3 points, you can find a normal to it (just like terrain surfaceNormal). To invert direction of the normal, swap arguments around. - Groups:
- Math - Vectors
Syntax
- Syntax:
- vector1 vectorCrossProduct vector2
- Parameters:
- vector1: Vector3D or Vector2D - since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided
- vector2: Vector3D or Vector2D - since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided
- Return Value:
- Array - vector [x, y, z]

Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- vectorAdd vectorDiff vectorDotProduct vectorCos vectorMagnitude vectorMagnitudeSqr vectorMultiply vectorDistance vectorDistanceSqr vectorDir vectorUp setVectorDir setVectorUp setVectorDirAndUp vectorNormalized vectorFromTo matrixMultiply matrixTranspose
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note
- Posted on Jun 28, 2014 - 09:12 (UTC)
-
1.22Algorithm:
It is recommended to use vectorCrossProduct instead of BIS_fnc_crossProduct.