Jump to content
  • Advertisement

Archived

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

Mexx Cuter

D3DLIGHT8 variable light point

This topic is 5278 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

Hi, What i would like to have is a light in space wich can move. The problem in my code is that it does not accept my variable floats and does not use them at all. With my floats the screen turns dark-grey. I have created the following source:

D3DLIGHT8 d3dLight;

	//Initialize the light structure.

	ZeroMemory(&d3dLight, sizeof(D3DLIGHT8));

	d3dLight.Type = D3DLIGHT_POINT;

	d3dLight.Diffuse.r = 1.0f;
	d3dLight.Diffuse.g = 1.0f;
	d3dLight.Diffuse.b = 1.0f;
				
	d3dLight.Ambient.r = 0.0f;
	d3dLight.Ambient.g = 0.0f;
	d3dLight.Ambient.b = 0.0f;
				
	d3dLight.Specular.r = 0.0f;
	d3dLight.Specular.g = 0.0f;
	d3dLight.Specular.b = 0.0f;
				
	d3dLight.Position.x = Light_X; // -100.0f;

	d3dLight.Position.y = Light_Y; //100.0f;

	d3dLight.Position.z = Light_Z; // -100.0f;


	d3dLight.Attenuation0 = 1.0f; 
	d3dLight.Attenuation1 = 0.0f; 
	d3dLight.Attenuation2 = 0.0f; 
	d3dLight.Range = 1000.0f;

Thank you. Those who find beautifull meanings in beautiful things are the cultivated.For these there is hope. They are the elect to whom beautiful things mean only beauty. -- Unknown --

Share this post


Link to post
Share on other sites
Advertisement
Fixed the problem,

placed the initialize function of the floats a line to low.
Problem is fixed.

Those who find beautifull meanings in beautiful things are the cultivated.For these there is hope.
They are the elect to whom beautiful things mean only beauty.
-- Unknown --

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!