Here is my attempt... I tried to modify your code as little as possible. Just compare the code side by side and you can see the changes I made. Just follow my comments and after a few minutes (hours?) you should see the general pattern. As you get better at Blitz Basic, you can encapsulate this into functions and use "structs" (Blitz's Types) to better organize.
(Good luck to me... I've never posted code before!)
Graphics3D 800,600,0,2
SetBuffer BackBuffer()
camera=CreateCamera()
CameraViewport camera,0,0,800,600
; Changed this to a point light for more dramatic effect.
light=CreateLight(2)
LightRange light, 5
col=8 : row=11 : total_cube=col*row : num=0 : spacer_cube=4 : xoffset#=24.1 : yoffset#=17.7
total_hexa=9 : spacer_hexa#=2.5
Dim cube(total_cube)
Dim hexa(total_hexa)
plane=CreateSprite()
SpriteViewMode plane, 2
EntityFX plane, 1
ScaleSprite plane, 25, 25
PositionEntity plane,0,0,23
; Sets up the detail of the shadow
Const shadowDetail = 512 ; or 128, 256, or 512 (no more than this, though!)
; Creates the shadow texture
; I normally would do this differently, but
; I want to do the minimalist effort so you
; can see how this done.
shadowTexture = CreateTexture( shadowDetail, shadowDetail, 256 )
EntityTexture plane, shadowTexture
; Create the camera which will take a snapshot of the shadows.
shadowCamera = CreateCamera()
CameraClsColor shadowCamera, 0, 50, 255
CameraProjMode shadowCamera, 0
CameraViewport shadowCamera, 0, 0, shadowDetail, shadowDetail
CameraZoom shadowCamera, 0.9
; remove ball 2 later
ball2=CreateSphere(3)
PositionEntity ball2,0,0,5
ScaleEntity ball2,.25,.25,.25
; end of remove section
Dim sinetable#(360),costable#(360)
light_spacer=4
For angle = 0 To 359
sinetable#(angle)=light_spacer*Sin(angle)
costable#(angle)=light_spacer*Cos(angle)
Next
x#=0 : y#=0 : depth=22
For columns = 1 To col
For rows = 1 To row
num=num+1
x#=rows*spacer_cube-xoffset#
y#=columns*spacer_cube-yoffset#
cube(num)=CreateCube()
PositionEntity cube(num),x#,y#,depth
EntityColor cube(num),0,120,255
Next
Next
x#=-4.7 : y#=0 : depth=8 : offset_hex=8 : alpha#=.9 : hexa_scale#=1.5
For hexs=1 To total_hexa
hexa(hexs)=CreateCube()
y#=hexs*spacer_hexa#-offset_hex
PositionEntity hexa(hexs),x#,y#,depth
RotateEntity hexa(hexs),0,hexs*(90/total_hexa),0
ScaleEntity hexa(hexs),hexa_scale#,1,hexa_scale#
EntityColor hexa(hexs),100,100,255
EntityAlpha hexa(hexs),alpha#
Next
speed#=.03 : angle=0 : angle2=34
While Not KeyHit(1)
For reps=1 To total_cube
TurnEntity cube(reps),.5,1.2,1.3
Next
For reps=1 To total_hexa
TurnEntity hexa(reps),0,1,0
MoveEntity hexa(reps),0,-speed#,0
If EntityY(hexa(reps)) <-10 Then PositionEntity hexa(reps),x#,12.5,depth
Next
; ball2 to remove after
PositionEntity ball2,sinetable#(angle),costable#(angle2),5
; end of remove section
PositionEntity light,sinetable#(angle),costable#(angle2),5
; SHADOW TIME!
; Hide the real camera
CameraProjMode camera, 0
; Show the shadow camera
CameraProjMode shadowCamera, 1
; Position the shadow camera where the light is
PositionEntity shadowCamera, sinetable#(angle),costable#(angle2),5
; Hide the background, textured plane
HideEntity plane
; Hide the big squares
For hexs = 1 To total_hexa
HideEntity hexa(hexs)
Next
; Color the cubes like shadows.
; Plus, make them unaffected by light!
; This will cause them to be flat colored.
For cubs = 1 To total_cube
EntityColor cube(cubs), 64, 64, 64
EntityFX cube(cubs), 1
Next
; Render this shadow world.
RenderWorld()
; Reset the cubes to their original state.
For cubs = 1 To total_cube
EntityFX cube(cubs), 0
EntityColor cube(cubs), 0, 120, 255
Next
; Reset the big squares to their original state.
For hexs = 1 To total_hexa
ShowEntity hexa(hexs)
Next
; Reset the plane to its original state.
ShowEntity plane
; Copy the shadow world to the texture that is on the plane.
; This updates the plane at the same time. It's like magic!
CopyRect 0, 0, shadowDetail, shadowDetail, 0, 0, BackBuffer(), TextureBuffer(shadowTexture)
; Hide the shadow camera
CameraProjMode shadowCamera, 0
; Show the real camera
CameraProjMode camera, 1
angle=angle+1
angle2=angle2+1
If angle>359 Then angle=0
If angle2>359 Then angle2=0
; COMMENT THIS OUT TO SEE THE SHADOW WORLD!
RenderWorld
Flip
Wend
End