Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3DLIGHT8 variable light point

Started by Mexx Cuter Jun 6, 2004 at 5:09 AM 0 replies 850+ views
Original Post
Mexx Cuter
Mexx Cuter
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 --
We can forgive a man for making a useful thing as long as he does not admire it. The only excuse for making a useless thing is that one admires it intensely.-- ? --
Mexx Cuter
Mexx Cuter
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 --
We can forgive a man for making a useful thing as long as he does not admire it. The only excuse for making a useless thing is that one admires it intensely.-- ? --

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.