4个顶点
{ D3DXVECTOR3(0.0f, 5.0f, 0.0f), D3DXVECTOR3(0.0f, 1.0f, 0.0f), 1.0f, 0.0f,},
{ D3DXVECTOR3(0.0f, 0.0f, 0.0f), D3DXVECTOR3(0.0f, 1.0f, 0.0f), 1.0f, 1.0f,},
{ D3DXVECTOR3(-5.0f, 5.0f, 0.0f), D3DXVECTOR3(0.0f, 0.0f, -1.0f), 0.0f, 0.0f,},
{ D3DXVECTOR3(-5.0f, 0.0f, 0.0f), D3DXVECTOR3(0.0f, 0.0f, -1.0f), 0.0f, 1.0f,},
最后两个是纹理坐标,
index是 1,2,4,1,4,3
然后加上纹理
g_pApp.GetDevice()->SetTexture( 0, pGrassTexture );
g_pApp.GetDevice()->SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
g_pApp.GetDevice()->SetTextureStageState(0,D3DTSS_COLOROP, D3DTOP_SELECTARG1);
渲染出来的时候为什么纹理最下面的一排像素的跑到最上面去了,最右边的一列像素跑到最左边去了??
不明白,盼解答。 |