Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 10th, 2010  |  syntax: C++  |  size: 0.89 KB  |  views: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. d3dLight.Type = D3DLIGHT_DIRECTIONAL;
  2.     d3dLight.Diffuse.r  = 1.0f;
  3.     d3dLight.Diffuse.g  = 1.0f;
  4.     d3dLight.Diffuse.b  = 1.0f;
  5.     d3dLight.Ambient.r  = 1.0f;
  6.     d3dLight.Ambient.g  = 1.0f;
  7.     d3dLight.Ambient.b  = 1.0f;
  8.     d3dLight.Specular.r = 0.0f;
  9.     d3dLight.Specular.g = 0.0f;
  10.     d3dLight.Specular.b = 0.0f;
  11.        
  12.     d3dLight.Position     = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
  13.     d3dLight.Direction    = D3DXVECTOR3( 0.0f, 0.0f, 1.0f);
  14.        
  15.     d3dLight.Attenuation0 = 0.0f;
  16.     d3dLight.Attenuation1 = 0.0f;
  17.     d3dLight.Attenuation2 = 0.0f;
  18.     d3dLight.Range = ((float)sqrt(FLT_MAX));
  19.        
  20.     // Set the property information for the first light.
  21.     hr = d3dDevice->SetLight(0, &d3dLight);
  22.     if (FAILED(hr))
  23.         THROW_ERROR_AND_EXIT("d3dDevice->SetLight");
  24.  
  25.     hr = d3dDevice->LightEnable(0, TRUE);
  26.     if (FAILED(hr))
  27.         THROW_ERROR_AND_EXIT("hr = d3dDevice->LightEnable");
clone this paste RAW Paste Data