sync on
 
texsize=256
 
gosub getwoventexture
 
paste image 1,1,1
 
sleep 1
 
cls
backdrop on
color backdrop 1
 
make object cube 1,100
texture object 1,1
ghost object on 1
 
while mouseclick()=0
 
   xangle#=wrapvalue(object angle x(1)+1.0)
   yangle#=wrapvalue(object angle y(1)+1.0)
   zangle#=wrapvalue(object angle z(1)+1.0)
   rotate object 1,xangle#,yangle#,zangle#
 
   sync
 
endwhile
 
end
 
getwoventexture:
 
   for x=1 to texsize step 2
      ink rgb(0,0,rnd(55)+200),0
      line x,1,x,texsize
   next i
   for y=1 to texsize step 2
      ink rgb(0,0,rnd(55)+200),0
      line 1,y,texsize,y
   next i
 
   get image 1,1,1,texsize,texsize
 
return