Can't see the light!

Blitz3D Forums/Blitz3D Programming/Can't see the light!

SkyCube(Posted 2005) [#1]
Can someone help me? I created this simple code, but I can't see the light:

Graphics3D 800,600
AppTitle "Lights Test"
SetBuffer BackBuffer()
Const KEY_LEFT =203
Const KEY_RIGHT= 205


;create floor
plane = CreatePlane()
PositionEntity plane,0,-1,0
pisotex = LoadTexture("greenplain.bmp")
EntityTexture plane,pisotex
FreeTexture pisotex

;create cube
cubo = CreateCube()
PositionEntity cubo,0,0,0
EntityAlpha cubo,0.3

;create camara
cam = CreateCamera()
CameraViewport cam,0,0,800,600
PositionEntity cam,5,2,5
PointEntity cam,cubo


;create light
l = CreateLight()
LightColor l,255,255,255
PositionEntity l,0,2,0
LightRange l,100
UpdateWorld
RenderWorld
Flip

While Not KeyDown(1)

If KeyDown(KEY_LEFT) Then MoveEntity cubo,1,0,0
If KeyDown(KEY_RIGHT) Then MoveEntity cubo,-1,0,0

UpdateWorld
RenderWorld
Flip

Wend

End

I tried fooling around with AmbientLight, but nothing. Thanks for any help you can provide.


DJWoodgate(Posted 2005) [#2]
Directional lights do not care about position, only orientation, and they are infinite so they do not care about range either, only lightcolor will effect their intensity.

In short you are lighting your cube from the front and then showing the back.


SkyCube(Posted 2005) [#3]
I changed the light to a point light and now I can see it. But how can I create a "light bulb" effect?