XMVector3ProjectStream

Projects a stream of 3D vectors from object space into screen space.

Syntax

XMFLOAT3* XMVector3ProjectStream(
         XMFLOAT3 *pOutputStream,
         size_t OutputStride,
         const XMFLOAT3 *pInputStream,
         size_t InputStride,
         size_t VectorCount,
         float ViewportX,
         float ViewportY,
         float ViewportWidth,
         float ViewportHeight,
         float ViewportMinZ,
         float ViewportMaxZ,
         CXMMATRIX Projection,
         CXMMATRIX View,
         CXMMATRIX World
)  

Parameters

pOutputStream
Type: XMFLOAT3 *

[out]

Address of the first XMFLOAT3 in the destination stream.

OutputStride
Type: size_t 

[in]

Stride, in bytes, between vectors in the destination stream.

pInputStream
Type: XMFLOAT3 *

[in]

Address of the first XMFLOAT3 in the stream to be transformed.

InputStride
Type: size_t 

[in]

Stride, in bytes, between vectors in the input stream.

VectorCount
Type: size_t 

[in]

Number of vectors to transform.

ViewportX
Type: float 

[in]

Pixel coordinate of the upper-left corner of the viewport. Unless you want to render to a subset of the surface, this parameter can be set to 0.

ViewportY
Type: float 

[in]

Pixel coordinate of the upper-left corner of the viewport on the render-target surface. Unless you want to render to a subset of the surface, this parameter can be set to 0.

ViewportWidth
Type: float 

[in]

Width dimension of the clip volume, in pixels. Unless you are rendering only to a subset of the surface, this parameter should be set to the width dimension of the render-target surface.

ViewportHeight
Type: float 

[in]

Height dimension of the clip volume, in pixels. Unless you are rendering only to a subset of the surface, this parameter should be set to the height dimension of the render-target surface.

ViewportMinZ
Type: float 

[in]

Together with ViewportMaxZ, value describing the range of depth values into which a scene is to be rendered, the minimum and maximum values of the clip volume. Most applications set this value to 0.0f. Clipping is performed after applying the projection matrix.

ViewportMaxZ
Type: float 

[in]

Together with MinZ, value describing the range of depth values into which a scene is to be rendered, the minimum and maximum values of the clip volume. Most applications set this value to 1.0f. Clipping is performed after applying the projection matrix.

Projection
Type: CXMMATRIX 

[in]

Projection matrix.

View
Type: CXMMATRIX 

[in]

View matrix.

World
Type: CXMMATRIX 

[in]

World matrix.

Return value

Type: XMFLOAT3 *

Returns the address of the first XMFLOAT3 in the destination stream.

Remarks

The ViewportX, ViewportY, ViewportWidth, and ViewportHeight parameters describe the position and dimensions of the viewport on the render-target surface. Usually, applications render to the entire target surface; when rendering on a 640480 surface, these parameters should be 0, 0, 640, and 480, respectively. The *ViewportMinZ and ViewportMaxZ are typically set to 0.0f and 1.0f but can be set to other values to achieve specific effects.

Requirements

Header: Declared in directxmath.h.