Is this the idea your after ? The object at the top ( small box ) is my light source. The top box is a shadow receiver AND caster. The bottom one does both as well. So the upper box is casting its own shadow on the one below it.
this is all accomplished by setting EACH object to "set shadow shading on".
Example :
rem Box 1
make object cube 1,5
color object 1,rgb(100,255,255)
position object 1,500,20,500
rem Box 2
make object cube 2,5
color object 2,rgb(100,255,255)
position object 2,501,28,501
rem Light object
make object cube 3,1
color object 3,rgb(255,255,255)
position object 3,500,100,500
set normalization on
set shadow shading on 1
set shadow shading on 2
set object light 3, 1
do
position object 3,500,40,510
position light 0,500,40,510
sync
loop
I just put all objects positions in a 3D space. The light object is set to x = 500 and Y = 40 and Z = 510. This is just an example of placement. Not a complete working demo.
If you want a working demo here is the example from this website.
` This code was downloaded from The Game Creators
` It is reproduced here with full permission
` http://www.thegamecreators.com
sync on
autocam off
rem Floor
make object cube 100,10
color object 100,rgb(255,255,255)
position object 100,0,-3,5
scale object 100,300,50,300
set ambient light 10
set point light 0,0,20,0
rem Shadow Caster
make object cube 101,5
position object 101,0,5,5
rem Light object
make object cube 102,1
position object 102,0,20,5
set normalization on
set shadow shading on 101
set object light 102, 1
rem Position Variables
xpos#=0
zpos#=0
rotx#=0
rem Camera
make camera 1000
position camera 1000,0,30,30
point camera 1000,0,0,0
do
if leftkey()=1 then xpos# = xpos# + .1
if rightkey()=1 then xpos# = xpos# - .1
if upkey()=1 then zpos# = zpos# - .1
if downkey()=1 then zpos# = zpos# + .1
if spacekey()=1 then rotx# = rotx#+1
position object 102,xpos#,20,zpos#
position light 0,xpos#,20,zpos#
rotate object 101,0,rotx#,0
sync
loop
"Son, I crap bigger then you !"