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.
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.