With 5.8 we can now play with vertices and uv data, so you can load in an image with 6 textures in it laid out like:
123
456
and then get DBPro to assign each face of a cube the relevant part of your loaded image.
This code will make the image so you can see how it works, but you can get rid of the texture making bit and just load in your own image.
sync on : sync rate 60 : autocam off
` make a texture (3 by 2) or load one in
makeatexture()
` make an object
make object cube 1,10
texture object 1,1
` make object to show what image looks like
make object plain 2,80,30
texture object 2,1
position object 2,0,0,10
` rearrange uv coordinates - faces are ordered
` front, back, top, bottom, right, left
lock vertexdata for limb 1,0
for face=1 to 6
for corner=1 to 4
vert=((face-1)*4)+corner-1
u#=get vertexdata u(vert)
v#=get vertexdata v(vert)
my=(face-1)/3
mx=face-(my*3)-1
newu#=((mx+u#)/3.0)
newv#=((my+v#)/2.0)
set vertexdata uv vert,newu#,newv#
next corner
next face
unlock vertexdata
position camera 0,0,-50
do
control camera using arrowkeys 0,1,1
turn object left 1,0.5
pitch object up 1,0.3
sync
loop
function makeatexture()
ink rgb(255,0,0),0 : box 0,0,128,128
ink rgb(0,255,0),0 : box 128,0,256,128
ink rgb(0,0,255),0 : box 256,0,384,128
ink rgb(255,0,255),0 : box 0,128,128,256
ink rgb(255,255,0),0 : box 128,128,256,256
ink rgb(0,255,255),0 : box 256,128,384,256
s=0
savetextsize=text size()
set text size 60
ink rgb(255,255,255),0
for y=0 to 1
for x=0 to 2
inc s
cx=(x*128)+64
cy=(y*128)+64
s$=str$(s)
text cx-(text width(s$)/2),cy-(text height(s$)/2),s$
circle cx,cy,60
next x
next y
set text size savetextsize
get image 1,0,0,384,256,1
endfunction
The only slight problem I have, which I hope someone can explain is you can see part of adjacent images on the very edge of some of the faces. This is because I don't know what to set uv data to be.
e.g. face 1 should have topleft uv of 0,0 and bottom right uv of third,half. But I assume it should be 'just under' the third and half, otherwise right side of face 1 will have a bit of texture 2, and bottom of face 1 will have a bit of texture 4.
So, if face 2 starts at 0.5, what should face one end at???
Boo!