在DirectX 9.0中使用纹理时如何解决受周围部分纹理影响的问题 RRS feed

  • 问题

  • 比如这样的一个FVF:

    struct XYZ_TEX1
        D3DXVECTOR3 position; // The position
        D3DXVECTOR3 normal;   // The surface normal for the vertex
        FLOAT tu, tv;   // The texture coordinates


    pVertices[0].position = D3DXVECTOR3(ix, iy, iz+1.0f);
    pVertices[0].normal = D3DXVECTOR3(-1.0f, 0.0f, 0.0f);
    pVertices[0].tu = 0.0f;
    pVertices[0].tv = 1.0f/16;

    pVertices[1].position = D3DXVECTOR3(ix, iy+1.0f, iz+1.0f);
    pVertices[1].normal = D3DXVECTOR3(-1.0f, 0.0f, 0.0f);
    pVertices[1].tu = 0.0f;
    pVertices[1].tv = 0.0f;

    pVertices[2].position = D3DXVECTOR3(ix, iy+1.0f, iz+0.0f);
    pVertices[2].normal = D3DXVECTOR3(-1.0f, 0.0f, 0.0f);
    pVertices[2].tu = 1.0f/16;
    pVertices[2].tv = 0.0f;

    pVertices[3].position = D3DXVECTOR3(ix, iy, iz+0.0f);
    pVertices[3].normal = D3DXVECTOR3(-1.0f, 0.0f, 0.0f);
    pVertices[3].tu = 1.0f/16;
    pVertices[3].tv = 1.0f/16;


    2015年9月21日 9:39


  • 您用的是D3DFVF_XYZRHW 标识码?您给的代码好像没什么信息,请参考下面一些文章吧:For DirectX 9

    Directly Mapping Texels to Pixels (Direct3D 9)

    For DirectX 10, Coordinate Systems (Direct3D 10)

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年9月22日 9:28
  • 你好,从代码结构体中可以看出是D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1这三者的结合,并没有RHW参数。



    2015年9月23日 10:03