Thank you very much!
I played around with yours and added in a step by step csg subtract pausing before and after the subtract, and showing wireframes. I even modified the subtraction brushes's vertexdata and I was happy to realize that it performed the subtraction correctly!
REM ----------------------------------------------
REM CSG EXPERIMENT INDI JUNE 21st 2007
REM DBP 6.3
rem MAKE A BUILDING FROM PURE CODE
REM ----------------------------------------------
autocam off : sync on : sync rate 60
REM make a ground reference
make matrix 1,40,40,2,2 : position matrix 1,-20,0,-20
Make_Building()
position camera 15,9,-35 : point camera 0,0,0
disable escapekey : while escapekey()=0
control camera using arrowkeys 0,1,2
text 1,1,"use arrows to move. hit escape to continue... fps: "+ STR$(screen fps())
fastsync : endwhile
`-----
make object box 100 , 10 , 2 , 30
position object 100 , -2 , 9 , 0
sync : sync : wait 2000
`-----
lock vertexdata for limb 100 , 0
vind = 2
set vertexdata position vind , get vertexdata position x( vind ) - 4 , get vertexdata position y( vind ) , get vertexdata position z( vind )
vind = 19
set vertexdata position vind , get vertexdata position x( vind ) - 4 , get vertexdata position y( vind ) , get vertexdata position z( vind )
vind = 18
set vertexdata position vind , get vertexdata position x( vind ) - 4 , get vertexdata position y( vind ) , get vertexdata position z( vind )
vind = 6
set vertexdata position vind , get vertexdata position x( vind ) - 4 , get vertexdata position y( vind ) , get vertexdata position z( vind )
vind = 14
set vertexdata position vind , get vertexdata position x( vind ) - 4 , get vertexdata position y( vind ) , get vertexdata position z( vind )
vind = 15
set vertexdata position vind , get vertexdata position x( vind ) - 4 , get vertexdata position y( vind ) , get vertexdata position z( vind )
unlock vertexdata
sync : sync : wait 2000
set object wireframe 1 , 1
sync : sync : wait 2000
hide object 100
sync : sync : wait 2000
`set object wireframe 1 , 0
`sync : sync : wait 2000
show object 100
sync : sync : wait 2000
perform csg difference 1 , 100
`position object 100 , -8 , 9 , 0
sync : sync : wait 2000
delete object 100
sync : sync : wait 2000
set object wireframe 1 , 1
`position camera 15,9,-35 : point camera 0,0,0
disable escapekey : while escapekey()=0
control camera using arrowkeys 0,1,2
text 1,1,"use arrows to move. hit escape to continue... fps: "+STR$(screen fps())
fastsync : endwhile
set object wireframe 1 , 0
sync: sync : wait 2000
disable escapekey : while escapekey()=0
control camera using arrowkeys 0,1,2
text 1,1,"use arrows to move. hit escape to continue... fps: "+STR$(screen fps())
fastsync : endwhile
for i = 1 to 2
if object exist(i)
delete object i
endif
next i
end
Function Make_Building()
REM ----------------------------------------------
REM BUILDING TEXTURE 1
REM ----------------------------------------------
rem border bricks
ink rgb(155,155,155),1
box 0,0,128,256
rem internal brick area
ink rgb(175,175,175),1
box 8,8,120,248
rem internal brick area
ink rgb(195,195,195),1
box 12,12,118,246
rem architectural gradient
box 12,12,118,246,rgb(155,155,155),rgb(222,222,222),rgb(155,155,155),rgb(222,222,222)
get image 1,0,0,128,256,1
cls
REM ----------------------------------------------
REM DOOR TEXTURE 2
REM ----------------------------------------------
rem border door
ink rgb(55,55,55),1
box 0,0,64,128
rem internal door area
ink rgb(75,75,75),1
box 8,8,56,120
rem door handle
ink rgb(35,35,35),1
box 44,64,54,70
get image 2,0,0,64,128,1
cls
REM ----------------------------------------------
REM WINDOW TEXTURE 3
REM ----------------------------------------------
box 0,0,64,32,rgb(155,155,155),rgb(30,30,30),rgb(155,155,155),rgb(30,30,30)
get image 3,0,0,64,32,1
cls
REM ----------------------------------------------
REM ROOF BOX TEXTURE 5
REM ----------------------------------------------
ink rgb(155,155,155),1
box 0,0,64,64
ink rgb(175,175,175),1
box 8,8,56,56
get image 5,0,0,64,64,1
cls
rem make a building
make object cube 1,10
scale object 1,100,200,100
position object 1,0,10,0
texture object 1,1
rem make a door and use it for the door cut but keep it for the door limb
make object cube 2,5.1
scale object 2,75,100,12.5
position object 2,0,2.5,-4.8
texture object 2,2
rem make window 1 cut and ghost
make object cube 3,5
scale object 3,100,50,12.5
position object 3,0,12.5,-5
ghost object on 3
fade object 3,25
texture object 3,3
rem make window 2 cut and ghost
make object cube 4,5
scale object 4,100,50,12.5
position object 4,0,17,-5
ghost object on 4
fade object 4,25
texture object 4,3
rem make a roof box
make object cube 5,10
scale object 5,70,30,70
position object 5,0,21,0
texture object 5,5
perform csg difference 1,2
perform csg difference 1,3
perform csg difference 1,4
endfunction