Hello friends,
Thank you for your help...This seems to have worked. I created a small sample which allows you to move around a light and modify the shadows range. You can use this freely if it helps you any. Take care.
Rem Project: Dark Basic Pro Project
Rem Created: Tuesday, May 15, 2012
Rem ***** Main Source File *****
Set display mode 640,480,32
Type ObjectShadows
Objno As integer
Meshno As integer
Range As integer
Shader As Boolean
EndType
AutoCam Off
Make Camera 1
Position Camera 1,0,30,-60
Point Camera 1,0,0,0
Make Object Box 1,20,20,20
Make Object Box 2,100,10,100
Position Object 1,0,0,0
Position Object 2,0,-20,0
Make Light 1
Set Point Light 1,10,30,30
Set Light Range 1,200
Make Object Sphere 3,-10
Position Object 3,10,30,30
Global shadow As ObjectShadows
shadow.Objno = 1
shadow.Meshno = -1
shadow.Range = 500
shadow.Shader = 0
Set Shadow Shading On shadow.Objno, shadow.Meshno, shadow.Range, shadow.Shader
Do
LightMovement()
ShadowRange()
Wait 1
LOOP
Wait Key
End
Function LightMovement()
x = Light Position X(1)
y = Light Position Y(1)
z = Light Position Z(1)
Set Shadow Position -1,x,y,z
If Inkey$() = "w"
Inc z,5
Position Light 1,x,y,z
Position Object 3,x,y,z
ENDIF
If Inkey$() = "s"
Dec z,5
Position Light 1,x,y,z
Position Object 3,x,y,z
ENDIF
If Inkey$() = "a"
Dec x,5
Position Light 1,x,y,z
Position Object 3,x,y,z
ENDIF
If Inkey$() = "d"
Inc x,5
Position Light 1,x,y,z
Position Object 3,x,y,z
ENDIF
If Inkey$() = "q"
Dec y,1
Position Light 1,x,y,z
Position Object 3,x,y,z
EndIf
If Inkey$() = "e"
Inc y,1
Position Light 1,x,y,z
Position Object 3,x,y,z
EndIf
ENDFUNCTION
Function ShadowRange()
If Inkey$() = "r"
Set Cursor 0,0
Inc shadow.Range,20
Print shadow.Range
Set Shadow Shading On shadow.Objno, shadow.Meshno, shadow.Range, shadow.Shader
ENDIF
If Inkey$() = "f"
Set Cursor 0,0
Dec shadow.Range,20
Print shadow.Range
Set Shadow Shading On shadow.Objno, shadow.Meshno, shadow.Range, shadow.Shader
ENDIF
ENDFUNCTION