Light colour

Blitz3D Forums/Blitz3D Beginners Area/Light colour

Chimeara(Posted 2004) [#1]
I was woundering if it is possible to change the colour (color to silly people) of a light (their deosn't seem to be a way, but it's somthing blitz should have)

can you change the colour of a light (not an ambient light) ?


GfK(Posted 2004) [#2]
LightColor() not working?


Chimeara(Posted 2004) [#3]
I was under the impression that it seosn't actually change the colour, it deosn't seem to

Sets the color of a light.
An r,g,b value of 255,255,255 will brighten anything the light shines on.

An r,g,b value of 0,0,0 will have no affect on anything it shines on.

An r,g,b value of -255,-255,-255 will darken anything it shines on. This is known as 'negative lighting', and is useful for shadow effects.

yea it deosn't change the colour for me, only the brightness


GfK(Posted 2004) [#4]
This works fine. Note that unlit surfaces will be effected by AmbientLight, so its best to use LightColor and AmbientLight alongside each other, rather than expecting an all-round solution from one or the other.
Graphics3D 800,600
AmbientLight 0,0,50 ;Comment this line out to prove that LightColor does actually work
cube = CreateCube()
camera = CreateCamera()
light = CreateLight(2)
MoveEntity light,-4,4,-4
LightRange light,10

MoveEntity camera,0,3,-10
LightColor light,0,0,255

While Not KeyDown(1)
	TurnEntity cube,0,1,0
	RenderWorld()
	Flip
Wend



Chimeara(Posted 2004) [#5]
yea yours definetly works, i think mine is tangled in a jumbled mess of if comands, thanx for the enligtenment.


Chimeara(Posted 2004) [#6]
ok it wasn't the if's afterall it was to do with the use of lightrange and lightconeangles.