Posted on 2008-08-10 11:19
orlando 阅读(387)
评论(0) 编辑 收藏 引用
纹理坐标
实际纹理坐标&相对纹理坐标
struct CUSTOMVERTEX
{
FLOAT x, y, z; //顶点位置
FLOAT u,v ; //顶点纹理坐标
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_TEX1)
//顶点数据
CUSTOMVERTEX g_Vertices[] =
{
{ -3, -3, 0.0f, 0.0f, 1.0f},
{ -3, 3, 0.0f, 0.0f, 0.0f},
{ 3, -3, 0.0f, 1.0f, 1.0f},
{ 3, 3, 0.0f, 1.0f, 0.0f }
};
设置为
//顶点数据
CUSTOMVERTEX g_Vertices[] =
{
{ -3, -3, 0.0f, 0.0f, 1.0f},
{ -3, 0, 0.0f, 0.0f, 0.5f},
{ 3, -3, 0.0f, 1.0f, 1.0f},
{ 3, 0, 0.0f, 1.0f, 0.5f }
};
只将一半纹理映射到图元上