zoukankan      html  css  js  c++  java
  • DitectX 90 3D 基本变换函数

    基本变换

    平移矩阵(translation matrix

    用于创建平移矩阵的D3DX函数

    D3DXMATIX *D3DXMatrixTranslation (

    D3DXMATRIX
    * pOut, //result

    FLOAT x,
    //Number of units to translate on x-axis

    FLOAT y,
    //Number of units to translate on y-axis

    FLOAT z
    //Number of units to translate on z-axis

    )

    旋转矩阵(rotation matrix

    D3DXMATRIX *D3DXMatrixRotationX(

    D3DXMATRIX
    *pOut, //result

    FLOAT Angle
    //Angle of rotation measured in radians

    };

    比例变换矩阵 (Scaling Matrix

    D3DXMATRIX *D3DXMatrixScaling (

    D3DXMATRIX
    * pOut , // result.

    FLOAT sx,
    //Number of units to translate on x-axis

    FLOAT sy,
    //Number of units to translate on y-axis

    FLOAT sz
    //Number of units to translate on z-axis

    );

     向量变换的函数

    D3DXVec3TransformCoord 函数对点进行变换, 并假定向量的第个分量为1。

    D3DXVECTOR * D3DVXec3TransformCoord (

    D3DXVECTOR3
    * pOut, //result

    CONST D3DXVECTOR3
    * pv, // The point to transform

    CONT D3DXMATRIX
    * pM //The transformation matrix

    );

    D3DXMATRIX T(…);
    //initialize a transformation matrix

    D3DXVECTOR p(…);
    //initialize a point

    D3DXVec3TransformCoord (
    &p, &p, &T); //transform the point

    D3DXVec3TransformNormal用于向量的变换, 并假定微量的第4个分量为0

    D3DXVECTOR3 * D3DXVec3TransformNormal(

    D3DXVECTOR3
    *pOut, // result.

    CONST D3DXVECTOR3
    * pv, // The vector to transform

    CONT D3DXMATRIX
    * pM //The transformation matrix

    );



    D3DXMATRIX T(…);
    //initialize a transformation matrix

    D3DXVECTOR v(…);
    //initialize a vector

    D3DXVec3TransformCoord (
    &v, &v, &T); //transform the point



    用于点数组的函数

    D3DXVECTOR3 *WINAPI D3DXVec3TransformCoordArray(

    D3DXVECTOR3
    * pOut,

    UINT OutStride,

    CONST D3DXVECTOR3
    * pV,

    UINT VStride,

    CONST D3DXMATRIX
    * pM,

    UINT n

    );

     pOut

    [in, out] Pointer to the D3DXVECTOR3 structure that is the result of the operation.

    OutStride

    [in] Stride between vectors in the output data stream.

    pV

    [in] Pointer to the source D3DXVECTOR3 array.

    VStride

    [in] Stride between vectors in the input data stream.

    pM

    [in] Pointer to the source D3DXMATRIX structure.

    n

    [in] Number of elements in the array.

    用于向量的数组的变换:

    D3DXVECTOR3 *WINAPI D3DXVec3TransformNormalArray(
    D3DXVECTOR3
    * pOut,

    UINT OutStride,

    CONST D3DXVECTOR3
    * pV,

    UINT VStride,

    CONST D3DXMATRIX
    * pM,

    UINT n

    );

     pOut

    [in, out] Pointer to the D3DXVECTOR3 array that is the result of the operation.

    OutStride

    [in] Stride between vectors in the output data stream.

    pV

    [in] Pointer to the source D3DXVECTOR3 array.

    VStride

    [in] Stride between vectors in the input data stream.

    pM

    [in] Pointer to the source D3DXMATRIX structure. To transpose a normal with a non-affine matrix, this matrix should be a transposed-inverse transformation matrix.

    n

    [in] Number of elements in the array.

    查看DirectX9.0 3D SDK

    《DirectX 9.0 3D游戏开发编程基础》 笔记

    江西理工大学 FangSH 2010-4-17 整理

  • 相关阅读:
    jmeter接口自动化-读取CSV文件执行测试用例
    文件流下载excel表格
    如何查看死锁的表
    学习笔记
    当你需要验证数组是否都是0
    实验二
    centos8 https访问报错
    Linux命令常用搜集持续更新
    一文搞懂C语言中指针、数组、指针数组、数组指针、函数指针、指针函数
    11
  • 原文地址:https://www.cnblogs.com/fangshenghui/p/1714318.html
Copyright © 2011-2022 走看看