Skip to content

Latest commit

 

History

History
125 lines (76 loc) · 2.26 KB

d3dxquaternion.md

File metadata and controls

125 lines (76 loc) · 2.26 KB
description ms.assetid title ms.topic ms.date topic_type api_name api_type api_location
D3DXQUATERNION structure (D3dx9math.h) - Describes a quaternion.
3d88ed17-5b0a-46d5-8fe6-d66e1fa26c13
D3DXQUATERNION structure (D3dx9math.h)
reference
05/31/2018
APIRef
kbSyntax
D3DXQUATERNION
HeaderDef
d3dx9math.h

D3DXQUATERNION structure (D3dx9math.h)

Note

The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.

Describes a quaternion.

Syntax

typedef struct D3DXQUATERNION {
  FLOAT x;
  FLOAT y;
  FLOAT z;
  FLOAT w;
} D3DXQUATERNION, *LPD3DXQUATERNION;

Members

x

Type: FLOAT

The x-component.

y

Type: FLOAT

The y-component.

z

Type: FLOAT

The z-component.

w

Type: FLOAT

The w-component.

Remarks

Quaternions add a fourth element to the [ x, y, z] values that define a vector, resulting in arbitrary 4D vectors. However, the following illustrates how each element of a unit quaternion relates to an axis-angle rotation (where q represents a unit quaternion (x, y, z, w), axis is normalized, and theta is the desired CCW rotation about the axis):

q.x = sin(theta/2) * axis.x
q.y = sin(theta/2) * axis.y
q.z = sin(theta/2) * axis.z
q.w = cos(theta/2)

C++ programmers can take advantage of operator overloading and type casting with the D3DXQUATERNION Extensions, which implement overloaded constructors and assignment, unary, and binary (including equality) operators.

Requirements

Requirement Value
Header
D3dx9math.h

See also

D3DX Structures

Vectors, Vertices, and Quaternions (Direct3D 9)