I wipped this up today. Its a snippet to paint on an a cube rotated at 0 degrees in realtime.
The method it uses is just simple math.
Enjoy
Rem ** RealTime Drawing by Xenocythe **
sync on
sync rate 60
autocam off
color backdrop 0
make object cube 1,1
move object 1,20
Color object 1,rgb(255,0,0)
make object cube 2,50
move object 2,80
Type coordinates
x
y
endtype
dim p(0) as coordinates
paint:
do
Pick Screen Mousex(),mousey(),55
position object 1,Get Pick Vector x(),Get pick Vector Y(),Get Pick Vector Z()
diffx#=object position x(1)-(-21)
diffy#=object position y(1)-(-21)
if diffx#<0 then diffx#=0
if diffx#>42 then diffx#=42
if diffy#<0 then diffy#=0
if diffy#>42 then diffy#=42
Text 20,20,str$(Screen FPS())
If Click(20,100,0,"View Model",rgb(255,255,255),rgb(255,0,0))=1 then goto view
if mouseclick()=1 and diffx#>0 and diffx#<42 and diffy#>0 and diffy#<42
create bitmap 1,84,84
box 0,0,84,84,rgb(255,255,255),rgb(255,255,255),rgb(255,255,255),rgb(255,255,255)
array insert at bottom p(0)
Max=array count(p(0))
p(max).x=diffx# : p(max).y=diffy#
for x=1 to max
dot (p(x).x*2),((42-p(x).y)*2),rgb(255,0,0)
dot (p(x).x*2)+1,((42-p(x).y)*2),rgb(255,0,0)
dot (p(x).x*2)-1,((42-p(x).y)*2),rgb(255,0,0)
dot (p(x).x*2),((42-p(x).y)*2)+1,rgb(255,0,0)
dot (p(x).x*2),((42-p(x).y)*2)-1,rgb(255,0,0)
dot (p(x).x*2)+1,((42-p(x).y)*2)+1,rgb(255,0,0)
dot (p(x).x*2)-1,((42-p(x).y)*2)-1,rgb(255,0,0)
next x
if image exist(1) then delete image 1
get image 1,0,0,84,84
delete bitmap 1
endif
if image exist(1) then texture object 2,1
sync
loop
view:
Do
Turn object right 2,1
If Click(20,140,0,"Paint Model",rgb(255,255,255),rgb(255,0,0))=1 then yrotate object 2,0 : goto paint
Sync
Loop
Function Click(X,Y,CE,Text$,C1,C2)
If Pressed=1
Else
Ink C1,0
If MouseX()>X And MouseX()<X+Text Width(Text$) And MouseY()>Y And MouseY()<Y+Text Height(Text$)
Ink C2,0
If MouseClick()=1 Then Pressed=1
Endif
Endif
If CE=1 Then Center Text X,Y,Text$
If CE=0 Then Text X,Y,Text$
EndFunction Pressed
The fps drops when your painting, but thats only because of all the stuff that I have going on while you paint.