Hi there.
Studying a little of fracturing a mesh, maybe not fast, but it would be worth studying this function. What it does, is cut a box in the middle randomly several times . Perhaps someone can find this useful for little purposes.
autocam off
sync on
ink rgb(0,255,0),0
box 0,0,100,100
ink rgb(255,0,0),0
set cursor 2,2:print "CHAFARI"
ink rgb(0,0,255),0:print "CUTTING"
ink rgb(0,155,255),0:print "HALVES"
ink rgb(255,0,255),0:print "FUNCTION"
ink rgb(255,255,0),0:for i= 1 to 15:ellipse 80,20,i,i:next i
ink rgb(255,255,255),0:box 2,70,90,95
ink rgb(0,0,0),0:set cursor 4,75:print "......"
get image 1,0,0,100,100
rem our main object (the box )
make object box 1,10,10,10
texture object 1,1
rem cutter object
make object box 1000,30,30,30
offset limb 1000,0,15,0,0
ghost object on 1000
fade object 1000,20
hide object 1000
position camera 0,10,-40
point camera 0,0,0
ob=2
do
ink rgb(255,255,255),0
set cursor 0,0
print "Press control"
g#=g#+0.1
if controlkey()
switch=1
for i= 1 to 9
clone object ob,1
cut(1,ob)
inc ob
next i
endif
if switch=1
print "We have cutted box in 10 pieces "
for i= 1 to 20
if object exist(i) then rotate object i,g#,g#,g#
next i
endif
sync
loop
rem each cut , we have two halves , so we first cut object 1...rotate cutter and cut object 2, so we get one object cuted in the middle.
function cut(a,b)
rotate object 1000,rnd(360),rnd(360),rnd(360)
perform csg difference a,1000
yrotate object 1000,object angle y(1000)+180
perform csg difference b,1000
move object left b,rnd(3):move object down b,rnd(3)
endfunction
Cheers.
I'm not a grumpy grandpa
