DirectX SDK

D3DXVec2CCW

The D3DXVec2CCW function returns the z-component by taking the cross product of two 2-D vectors.

float D3DXVec2CCW(
  const D3DXVECTOR2* pV1,
  const D3DXVECTOR2* pV2
); 

Parameters

pV1
A pointer to a source D3DXVECTOR2 structure.
pV2
A pointer to a source D3DXVECTOR2 structure.

Return Values

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, in code:

pV1->x * pV2->y - pV1->y * pV2->x

If the value of the z-component is positive, the vector V2 is counter-clockwise from the vector V1. This information is useful for back-face culling.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxmath.h.
  Library: Use d3dx.lib.

See Also

D3DXVec2Dot