Thread: directx-how to use no texture

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

  2. #2
    Registered User Vick jr's Avatar
    Join Date
    May 2009
    Location
    Galifray
    Posts
    27
    Quote Originally Posted by Bubba View Post
    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!
    Frogblast the ventcore!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. d3d9 c++ texture wrapper... again...
    By yaya in forum Game Programming
    Replies: 0
    Last Post: 04-01-2009, 01:08 PM
  2. D3d Texture Wrapper == ARRRGGGGHHH
    By yaya in forum Game Programming
    Replies: 1
    Last Post: 03-25-2009, 06:41 PM
  3. Replies: 4
    Last Post: 02-27-2008, 03:10 PM
  4. OpenGL - look trough surface -nehe lesson
    By GanglyLamb in forum Game Programming
    Replies: 8
    Last Post: 08-24-2006, 11:06 PM
  5. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM