Quote: "Very neat trick! thank you for sharing and maybe I can find a use for it, but that cell shading, I really want to use!"
@MrValentine
I hadn't see your post sorry . Thanks for testing.
In first attempts, I made a poor cone projection just to show the results, now I improved the code, instead of rotate object and set camera orientation to that object, I rotate both camera & object, and it looks to be smoother. We just need ajust the power light/fog/ambient light that we desire .
set display mode 1024,768,32
rem Wall texture
ink rgb(100,60,0)
box 2,2,29,29
get image 1,0,0,30,30
autocam off
sync on
hide mouse
set ambient light 3
fog on:fog distance 150
make light 2:set light range 2,200
color backdrop 5
set light range 0,150
rem making the torch cone
for i= 1 to 50
make object box i,3,20,1
yrotate object i,7.2*i
move object i,4
next i
make object box 51,0,0,0
for i= 1 to 50
make mesh from object i,i
add limb 51,i,i
offset limb 51,i,object position x(i),0,object position z(i)
delete object i
next i
xrotate object 51,90
make mesh from object 1,51
delete object 51
rem torch
make object 2,1,1
hide limb 2,0 rem hiding the cone but projecting shadows
set global shadow color 0,0,0,230
set shadow shading on 2,0,550,1
rem torch dumy
make object cylinder 50,5:scale object 50,100,500,100
make mesh from object 1,50:delete object 50
make object cone 50,10
add limb 50,1,1
xrotate object 50,-80
lock object on 50
position object 50,3,-10,20
position light 2,3,-11,60
rem LOAD HERE YOUR LEVEL ****************************
make object box 500,40,15,40
make object box 501,40,10,8
position object 501,40,-2.5,0
make object box 502,30,15,20
position object 502,75,0,-5
make object box 503,8,10,30
position object 503,75,-2.5,-30
make object box 504,40,30,40
position object 504,75,6,-60
make object plain 600,50,50
for i= 500 to 504
perform csg difference 600,i
delete object i
next i
texture object 600,1:scale object texture 600,5,5
position object 600,0,20,0
scale object 600,200,200,200
set object radius 600,0
rem *************************************************
position object 2,-20,20,-20
make light 3:position light 3,-14,10,357:set light range 3,150:color light 3,rgb(0,255,0)
do
ink rgb(255,255,255),1
fps$="DBPro Fps: "+str$(screen fps())
set cursor 5,400:print fps$
print camera position x()
print camera position z()
rem camera movements
if upkey() then move camera 0.5
if downkey() then move camera -0.5
rem forzar la camara a estar en el suelo
xx#=camera position x()
zz#=camera position z()
position camera xx#,20,zz#
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
rotate object 2,cam#,a#,0
position object 2 ,camera position x(),camera position y()-2,camera position z()
position light 2,object position x(2),object position y(2)+10,object position z(2)
set shadow position -1,object position x(2),object position y(2),object position z(2)
sync
loop
Cheers.
I'm not a grumpy grandpa
