Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Materials, why arnt they working

This topic is 5842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im a bit new to Direct 3D, but i cant get my materials to change the scene. I think im just missing something basic. Should i use materials? So far its a bit like this: 3DMATERIAL mtrl; D3DMATERIALHANDLE hmtrl; ZeroMemory( &mtrl, sizeof(D3DMATERIAL) ); mtrl.dwSize = sizeof(D3DMATERIAL); mtrl.dcvAmbient.r = 0.5f; mtrl.dcvAmbient.g = 0.5f; mtrl.dcvAmbient.b = 0.5f; mtrl.dcvAmbient.a = 0.5; mtrl.dcvEmissive.r = 0.5; mtrl.dcvEmissive.g = 1.0f; mtrl.dcvEmissive.b = 10.5; mtrl.dcvEmissive.a = 0.5; g_pmtrlObjectMtrl->SetMaterial( &mtrl ); g_pmtrlObjectMtrl->GetHandle( pd3dDevice, &hmtrl ); pd3dDevice->SetLightState( D3DLIGHTSTATE_MATERIAL, hmtrl ); pd3dDevice->SetLightState( D3DLIGHTSTATE_AMBIENT, 0xaaaaaaaa ); Do i need any more? Thnx Yratelev.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!