Quote: "Having established that you can do it, I'm now going to suggest that you don't. Not unless you just want to take on the challenge."
To be honest it is just to see if I can and if it will work better and faster in appgamekit. I think it will.
Quote: "If you want to do it because you need the end results, as in, you want to create a sprite sheet from a 3D model, then I would suggest using Blender "
I use iClone v7.93, it makes all my frame images then I just make them all into a sprite, but Doing this will be faster and easier.
Plus it was already done so I am going to try myself if possible.
I already have the model loaded up and animated, just need to figure out the rest. but wow, I'm not to sure lol.
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "3d to sprite maker" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Imw=5 `How many images you want across in the final image
frameskip=2 `How many frames you want skip (so if it's set to 2 it will skip every other frame)
filename$="axebrute" `name of object
sw=GetScreenBoundsLeft()
sh=GetScreenBoundsBottom()
spr=sw/2+100
spb=sh/2+100
spl=sw/2-(spr-sw/2)
spt=sh/2-(spb-sh/2)
LoadObjectWithChildren (1,filename$+".x")
ObjectImage=loadimage("axebrute_D.png")
ObjectImage_2=loadimage("axebrute_D2.png")
ObjectImage_3=loadimage("axebrute_N.png")
SetObjectImage( 1, ObjectImage, 1 )
SetObjectImage( 1, ObjectImage_2, 2 )
SetObjectImage( 1, ObjectImage_3, 3 )
ox#=getcamerax(1)
oz#=getcameraz(1)
remstart
a2box spl,spt,spr,spb,rgb(0,255,255)
text spr+1,spb+1,str$(spr-spl)+"x"+str$(spb-spt)
stop object 1
set camera to image 0,1,sw,sh
sync
tof=total object frames(1)
maxim=1
for x=1 to tof step frameskip
inc maxim
set object frame 1,x
sync
paste image 1,0,0
get image maxim,spl,spt,spr,spb,1
next x
delete object 1
maxim#=maxim
maxy=int((2-maxim#)/imw)*(spt-spb)
maxx=Imw*(spr-spl)
for x=2 to maxim `Removes any black pixels from the object and converts the background to black
cls 0
paste image x,0,0
for ix=0 to image width(x)
for iy=0 to image height(x)
p=point(ix,iy)
r=rgbr(p)
g=rgbg(p)
b=rgbb(p)
if r+g+b=0 then a2dot ix,iy,rgb(1,1,1)
if r+g=0 and b=253 then a2dot ix,iy,rgb(0,0,0)
next iy
next ix
get image x,0,0,image width(x),image height(x),1
if escapekey()=1 then end
text 0,image height(x),"Compiling.."
sync
next x
cls 0
create bitmap maxim+1,maxx,maxy
for x=2 to maxim
paste image x,xpos,ypos
inc imwidth
inc xpos,spr-spl
if imwidth>imw then inc ypos,spb-spt:xpos=0:imwidth=0
next x
get image maxim+2,0,0,maxx,maxy,1
if file exist(Filename$+".bmp") then delete file Filename$+".bmp"
save image Filename$+".bmp",maxim+2
remend
oy#=100
oz#=-140
ox#=0
PlayObjectAnimation( 1, "", 1, 2000, 1, 0 )
SetObjectAnimationSpeed( 1, 30 )
do
if GetRawMouseLeftPressed()=1
spr=getrawmousex()
spb=getrawmousey()
spl=sw/2-(spr-sw/2)
spt=sh/2-(spb-sh/2)
endif
//ox#=getcamerax(1)
//oz#=getcameraz(1)
//oy#=getcameray(1)
if GetRawMouseLeftPressed()=1 then dec oz#,1.02
//if downkey()=1 then inc oy#,0.02
//if leftkey()=1 then inc oz#,0.1
//if rightkey()=1 then dec oz#,0.1
//
print(ox#)
print(oy#)
Print( oz# )
SetCameraPosition(1, ox#,oy#,oz#)
Sync()
loop
edit:
I got it to get each frame image, im getting there
tof=GetObjectAnimationDuration(1,GetObjectAnimationName( 1, 1 ))
for x=1 to tof step frameskip
inc maxim
SetObjectAnimationFrame(1, GetObjectAnimationName( 1, 1 ), x, 1 )
getimage (maxim,spl,spt,spr,spb)
next x