|
|
发表于 2008-4-18 07:45:00
|
显示全部楼层
Re:怎么设置不同的纹理?
把立方体分成不同的subset
DWORD* attributeBuffer = 0;
Mesh->LockAttributeBuffer(0, &attributeBuffer);
for(int a = 0; a < 4; a++)
attributeBuffer[a] = 0;
for(int b = 4; b < 8; b++)
attributeBuffer = 1;
for(int c = 8; c < 12; c++)
attributeBuffer[c] = 2;
Mesh->UnlockAttributeBuffer();
画的时候
for(int i = 0; i < NumSubsets; i++)
{
Device->SetTexture( 0, Textures );
Mesh->DrawSubset( i );
}
|
|