That's fine until the cube is textured, borrowing some code from the forum....
set display mode 640,480,32
sync off : sync rate 60 : hide mouse
obj=1
position camera 0,0,-40
point camera 0,0,0
sync on
af=1
q=180
` 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
position object 1,0,0,1
` 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
gosub rot
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
rot:
if af=1
a# = wrapvalue(a#+1)
b# = 0
if int(a#/q)=a#/q then af=0
else
a# = 0
b# = wrapvalue(b#+1)
if int(b#/q)=b#/q then af=1
endif
rotate object 1,a#,b#,0
text 10,10,str$(a#)+" "+str$(b#)
return
`````````````````````````````````````
removing the 2 angle resets at line 88 and 91 makes it ok, except for the 180 degree rotation, would be nice to have 90
cheers