Originally Posted by
Bubba
1. SetTexture(0,0) sets texture sampler 0 to use no texture. Make sure you have your mesh material set, make sure you have your light set and turned on and make sure you have the diffuse material source set correctly.
2. You would need an orientation class or a frame class to orient an object correctly. The frame class does essentially what the camera does for the view except the final matrix is the transpose of what the camera would compute.
I initialize the material to be red with this code:
Code:
D3DMATERIAL9 material;
ZeroMemory(&material, sizeof(D3DMATERIAL9));
material.Diffuse = D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f);
material.Ambient = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
material.Specular= D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
then use it with no texture with this code (d3ddev is the directx device):
Code:
d3ddev->SetMaterial(&material);
d3ddev->SetTexture(0,NULL);
There is no texture, but I can't get the color to to constant. It is colored by my lights (if I have lighting enabled when I'm rendering the objects), but is always white otherwise. I want to it have a constant color and not be affected by lights.
One more thing: how to I clear a std::basic_stringstream<TCHAR> so that it will have no characters in it? I've tried the clear() function and sync() but nothing works. I'm using the stream to output information like camera position and rotation, so i need to clear it every frame to fill it with new data.
Thanks!