Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.
Returns the z-component by taking the cross product of two 2D vectors.
Syntax
FLOAT D3DXVec2CCW(
_In_ const D3DXVECTOR2 *pV1,
_In_ const D3DXVECTOR2 *pV2
);
Parameters
-
pV1 [in]
-
Type: const D3DXVECTOR2*
Pointer to a source D3DXVECTOR2 structure.
-
pV2 [in]
-
Type: const D3DXVECTOR2*
Pointer to a source D3DXVECTOR2 structure.
Return value
Type: FLOAT
The z-component.
Remarks
This function determines the z-component by determining the cross-product based on the following formula: ((x1,y1,0) cross (x2,y2,0)). Or as shown in the following example.
pV1->x * pV2->y - pV1->y * pV2->x
If the value of the z-component is positive, the vector V2 is counterclockwise from the vector V1. This information is useful for back-face culling.
Requirements
Requirement | Value |
---|---|
Header |
|
Library |
|
See also