Quote: "Sadly none of those examples worked for me and one of them has been detected as malware "
Sorry I didn't see this post. That is queer...only dba examples can't be malware....any way just tested for virus here and all is correct ... perhaps is a false positive for your antivirus.
Also it is odd that these examples do not work for you.
what version of darkbssic are you using?
Edit
In order you don't have to download any file, try this snippent with your own images .
Boolean objects in Darklights.
autocam off
sync on
lm start
load image "madera.bmp",1
load image "metal.jpg",2
create(1000,1000,0,1000,2)
make object box 1,80,80,20
make object box 2,30,30,30
perform csg difference 1,2:delete object 2
position object 1,0,40,0
`we go to the funcion only when objet is ready in ist position...rotation...scale etc.
texture(1,2)
`making some booleans test
make object box 5,10,60,60
make object box 6,30,40,40
perform csg difference 5,6:delete object 6
position object 5,-60,30,130:yrotate object 5,80
texture(5,1)
make object box 6,100,40,100
make object box 7,80,40,80
move object up 7,10
perform csg difference 6,7:delete object 7
position object 6,0,20,0
texture(6,1)
make object box 7,60,60,60
make object box 8,50,50,60
move object 8,10
perform csg difference 7,8:delete object 8
position object 7,-270,53,-88
yrotate object 7,45
texture(7,1)
lm add point light 15,80,100,335, 10,10,5
lm add point light -270,53,-88,235, 0,18,0
`ambient lights
lm set ambient light 0.2, 0.2, 0.2
lm set ambient occlusion on 20, 50, 1
`building lights
lm build collision data
lm set light map name "boolean"
lm build light maps 512, 1, 1
position camera -50,50,-50
point camera 0,0,0
do
set cursor 0,0
print camera position x()
print camera position y()
print camera position z()
gosub camera
sync
loop
camera:
control camera using arrowkeys 0,0.2,0.2
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
if leftkey() then move camera left 0.2
if rightkey() then move camera right 0.2
return
function create(obj,x,y,z,texture)
make object box obj,x,y,z
texture object obj,texture
lm add collision object obj
lm add light map object obj
endfunction
function texture(obj,texture)
lm add collision object obj
lm add light map object obj
texture object obj,texture
endfunction
Making a boolean and spliting object
`Split object into triangles for working with GAMEFX commands
autocam off
sync on
make light 1
color light 1,rgb(0,255,0)
position light 1,50,20,20
make light 2:color light 2,rgb(255,255,0):position light 2,-50,30,-30
load image "pared.bmp",1
`making the boolean
make object box 1000,30,30,10
make object box 1001,10,10,30
perform csg difference 1000,1001
delete object 1001
make mesh from object 1,1000
make memblock from mesh 1,1
delete object 1000
make mesh from memblock 2,1
make object 1000,2,1
position object 1000,50,0,0
ob=1
set object cull 1000,0
lock vertexdata for limb 1000,0
vertices = get vertexdata vertex count()
for i= 0 to vertices -3 step 3
x# = get vertexdata position x(i+2)
y# = get vertexdata position y(i+2)
z# = get vertexdata position z(i+2)
xx# = get vertexdata position x(i)
yy# = get vertexdata position y(i)
zz# = get vertexdata position z(i)
xxx# = get vertexdata position x(i+1)
yyy# = get vertexdata position y(i+1)
zzz# = get vertexdata position z(i+1)
make object triangle ob,x#,y#,z#,xx#,yy#,zz#,xxx#,yyy#,zzz# `making triangle every three vertex
texture object ob,1:set object radius ob,-1 `avoid object disappear
set object normals ob
inc ob
next i
unlock vertexdata
`Giving the correct UV to every triangle ======================
for i= 1 to ob-1
gosub texturiza
scale object texture i,0.05,0.05
next i
`==============================================================
position camera -50,50,-50
point camera 0,0,0
make object box 5150,100,1,100
position object 5150,0,-20,0
`empty mesh for final object
make object triangle 9000,0,0,0,0,0,0,0,0,0
do
set cursor 0,0:print "Press Spacekey to see triangles"
print "Fly with cursorkey "
if spacekey()
print "Press Controlkey to save Dbo "
endif
text object screen x(1000)-50,object screen y(1000)-50,"Original object "
if spacekey() then d=10 else d=0
g#=g#+0.2
for i= 1 to ob-1
if object exist(i) then yrotate object i,(g#/2)+rnd(d)
next i
`unifying all triangles in a single object
if controlkey()
r=r+1
if r=2
for i= 1 to ob-1
make mesh from object i,i
add limb 9000,i,i
delete object i
set object cull 9000,0:texture object 9000,1
next i
save object "bobabi.dbo",9000:sleep 500
endif
endif
gosub camera
sync
loop
`Giving UV to all triangles depending its vertex position
texturiza:
lock vertexdata for limb i,0
vertes = get vertexdata vertex count()
for t =0 to vertes
x# = get vertexdata position x(t)
y# = get vertexdata position y(t)
z# = get vertexdata position z(t)
if object size z(i)<object size x(i) and object size z(i)<object size y(i) then set vertexdata uv t,x#,y#
if object size x(i)<object size z(i) and object size x(i)<object size y(i) then set vertexdata uv t,z#,y#
if object size y(i)<object size x(i) and object size y(i)<object size z(i) then set vertexdata uv t,x#,z#
next i
unlock vertexdata
set object normals t
return
rem **************************************************************************************************
camera:
control camera using arrowkeys 0,0.1,0.1
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
if leftkey() then move camera left 0.1
if rightkey() then move camera right 0.1
return
Report something back . What is the mesage error that you have there.
Cheers.
I'm not a grumpy grandpa
