1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-21 11:50:05 +00:00
9 Stereo3D
Chuck Walbourn edited this page 2017-07-13 01:47:10 -07:00

Stereo3DMatrixHelper.h/.cpp contains a prototype set of functions for creating Stereo 3D projections. It was never fully validated or completed, but might be a useful starting point.

Functions

This function filled out a default STEREO_PARAMETERS which you could then modify before passing on to the other functions.

void StereoCreateDefaultParameters(STEREO_PARAMETERS& stereoParameters);

These functions compute the stereo projection matrices. You'd call it twice, once for STEREO_CHANNEL_LEFT and once for STEREO_CHANNEL_RIGHT to get two matrices. If you pass nullptr for the pStereoParameters parameter, you get the values obtained from StereoCreateDefaultParameters.

XMMATRIX StereoProjectionFovLH(const STEREO_PARAMETERS* pStereoParameters,
    STEREO_CHANNEL Channel,
    float FovAngleY, float AspectRatio, float NearZ, float FarZ,
    STEREO_MODE StereoMode = STEREO_MODE_NORMAL);

XMMATRIX StereoProjectionFovRH(const STEREO_PARAMETERS* pStereoParameters,
    STEREO_CHANNEL Channel,
    float FovAngleY, float AspectRatio, float NearZ, float FarZ,
    STEREO_MODE StereoMode = STEREO_MODE_NORMAL);

Remarks

A simplified version of this header was shipped in the Windows 8.1 Store app Direct3D stereoscopic 3D sample.