How can I texture a D3DXCreateBox on direct3d???

How can I texture a D3DXCreateBox???

Or at least add colour because now it's white (1)

for now it's a fill and not a wireframe




here is my code for the box I made

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
ID3DXMesh* meshBase = NULL;

///////////////////////

D3DXCreateBox(g_pd3dDevice,20.0f,20.0f,30.0f, &meshBase, NULL);

/////////////////////////////////////////////

VOID SetupMatricesObject()
{


    D3DXMATRIXA16 matWorld;
	D3DXMATRIXA16 matScale;
	D3DXMATRIXA16 matRotation;
	D3DXMATRIXA16 matTranslation;

	D3DXMatrixIdentity (&matWorld);
    UINT  iTime  = timeGetTime() % 3000;
    FLOAT fAngle = iTime * (2.0f * D3DX_PI) / 3000.0f;
	
	D3DXMatrixScaling( &matScale, 0.02f, 0.02f, 0.02f );
	D3DXMatrixTranslation(&matTranslation, 60.0f, 110.0f, 0.0f);
	D3DXMatrixMultiply (&matWorld, &matTranslation, &matScale);

	g_pd3dDevice->SetTransform( D3DTS_WORLD, &matRotation );
	g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );

	

}

///////////////

if( meshBase != NULL )
        meshBase->Release();

////////////////

SetupMatricesBase();
meshBase->DrawSubset(0);
Topic archived. No new replies allowed.