BTW: More low-level commands for this kind of thing are comming in P5.
Unlike some other languages however, you don't have to use the mesh commands to create primitives like planes (in DBP a plane is a definate size, unlike maths) or triangles. As you are a Blitz3D user, this may seem a little strange.
Memblocks also allow you to manipulate vertex colours & normals of vertices. Vertex Alpha is not available yet unfortunately (as far as I know)
On a different subject, This code snippet by Kevil for transparency on objects is useful as it replaces the crap GHOST OBJECT command): (Demo code included, includes opacity mapping code as well)
sync on : sync rate 0
set display mode 1024,768,32
randomize timer()
rem create green texture
for x=0 to 128
for y=0 to 128
ink rgb(rnd(100),200+rnd(50),rnd(100)),0
dot x,y
next y
next x
get image 1,0,0,128,128
rem create opacity map
for x=0 to 128
for y=0 to 128
x#=x : y#=y
ink rgb((sin((x#/128.00)*180.00)*sin((y#/128.00)*180.00))*255,(sin((x#/128.00)*180.00)*sin((y#/128.00)*180.00))*255,(sin((x#/128.00)*180.00)*sin((y#/128.00)*180.00))*255),0
dot x,y
next y
next x
get image 2,0,0,128,128
ink rgb(255,255,255),0
rem make cube object
make object sphere 1,10
texture object 1,1
rem make matrix
make matrix 1,1000,1000,10,10
rem position object
move camera 20
position object 1,camera position x(),camera position y(),camera position z()
move camera -20
rem vars
time=timer()
transparencytype=0
percentage#=100.00
rem LOOP
do
text 0,0,str$(screen fps())
text 0,20,str$(percentage#)
text 0,60,"Press 't' for transparency effect"
text 0,80,"Press 'o' for opacity mapping"
text 0,100,"Press up and down to change percentage"
rem time stuff
dt#=(timer()-time)/1000.0
time=timer()
rem rotate object
yrotate object 1,wrapvalue(object angle y(1)+(120*dt#))
if transparencytype=0
text 0,40,"TRANSPARENCY EFFECT"
if downkey()=1
percentage#=percentage#-(50.0*dt#)
if percentage#>100.00 then percentage#=100.00
settransparency(1,1,percentage#)
endif
if upkey()=1
percentage#=percentage#+(50.0*dt#)
if percentage#>100.00 then percentage#=100.00
settransparency(1,1,percentage#)
endif
endif
if transparencytype=1
text 0,40,"OPACITY MAPPING"
if downkey()=1
percentage#=percentage#-(50.0*dt#)
if percentage#>100.00 then percentage#=100.00
setopacitymappingon(1,1,2,percentage#)
endif
if upkey()=1
percentage#=percentage#+(50.0*dt#)
if percentage#>100.00 then percentage#=100.00
setopacitymappingon(1,1,2,percentage#)
endif
endif
if inkey$()="t" then transparencytype=0 : settransparency(1,1,percentage#)
if inkey$()="o" then transparencytype=1 : setopacitymappingon(1,1,2,percentage#)
sync
loop
rem THE FUNCTIONS
function settransparency(object,image,percentage as float)
make memblock from image image,image
for x=1 to memblock dword(image,0)
for y=1 to memblock dword(image,4)
write memblock byte image,((((y-1)*memblock dword(image,4))+(x-1))*4)+15,int(percentage*2.55)
next y
next x
make image from memblock image,image
set object transparency object,1
endfunction
function setopacitymappingon(object,image,opacitymap,percentage as float)
make memblock from image image,image
make memblock from image opacitymap,opacitymap
part#=percentage/100.00
for x=1 to memblock dword(image,0)
for y=1 to memblock dword(image,4)
pos=((((y-1)*memblock dword(image,4))+(x-1))*4)+15
write memblock byte image,pos,part#*memblock byte(opacitymap,pos-3)
next y
next x
make image from memblock image,image
set object transparency object,1
endfunction