Okay - that seems to help! However, I'm still having no dice with the actual shadow code. I must be missing something. Here's a simple demo I put together...
I think the code ought to be casting a shadow, but I don't see it. What am I doing wrong?
;-------------------------------------- ; Simple SSwift Shadow Demo ;-------------------------------------- Include "Swift Shadow System.bb" ; Initialise graphics + camera Graphics3D 640,480,16,2 ClearTextureFilters cam=CreateCamera() arenalight=CreateLight() LightColor arenalight,100,150,150 period=1000/UPS time=MilliSecs()-period Const UPS=60 ; Load Meshes + Textures Global samplecone = CreateCone() EntityColor samplecone,255,150,150 Global arena = CreateCube() EntityColor arena,140,190,240 ScaleEntity arena,20,0.05,20 PositionEntity arena,0,-0.1,0 EntityShininess arena,0.5 ; Position and animate Entities PositionEntity cam,0,1,0 RotateEntity cam,0,0,0 PositionEntity arena,0,0,0 PositionEntity samplecone,0,2,8 RotateEntity samplecone,0,180,0 PositionEntity arenalight,0,20,0 ; Initialise Shadow Casters/REceivers Cast_Light(arenalight,500) Cast_Shadow(samplecone) Receive_Shadow(arena) .MainLoop Repeat ; Camera Movement code If KeyDown(200) MoveEntity cam,0,0,0.15 If KeyDown(208) MoveEntity cam,0,0,-0.15 If KeyDown(203) TurnEntity cam,0,2,0 If KeyDown(205) TurnEntity cam,0,-2,0 ; Frame Limiting Code Start Repeat elapsed=MilliSecs()-time Until elapsed ticks=elapsed/period tween#=Float(elapsed Mod period)/Float(period) For k=1 To ticks time=time+period If KeyHit(1) End UpdateWorld Next ; End Frame Limiting TurnEntity samplecone,1,2,3 Update_Shadows(cam) ; Update Shadows RenderWorld tween ; Draw World (tween indicates 60fps) Flip Forever
I think the code ought to be casting a shadow, but I don't see it. What am I doing wrong?