Updated it to make it simpler to use, just save this code in a directory with some rigged models without animation:
`Simple Skeletal system test by James Masson
`20/05/03
`DBpro demo
`Mouse 2 selects bone
`Mouse x rotates object
`Mouse 1+move x/y rotates selected limb/bone in the x/y dimensions
`Spacekey moves the object in the direction it faces
`Esc to exit
sync on
hide mouse
color backdrop 0
backdrop off
getfile:
print "Input name of rigged .x model:"
input filename$
if file exist(filename$+".x")=1
load object filename$+".x",1
while limb exist(1,l)=1
inc l
inc max_limbs,1
endwhile
dec max_limbs,1
else
print "Could not load object, try again"
goto getfile
endif
backdrop on
autocam off
make object cube 2,1
ghost object on 1
ghost object on 2
do
if mouseclick()=2 then mc2=1
if mc2=1 and mouseclick()=0
mc2=0
inc ls,1
if ls>max_limbs then ls=0
endif
if mouseclick()=1
l_xrot#=wrapvalue(limb angle x(1,ls)+mousemovey())
l_yrot#=wrapvalue(limb angle y(1,ls)+mousemovex())
rotate limb 1,ls,l_xrot#,l_yrot#,limb angle z(1,ls)
else
ry#=wrapvalue(ry#+mousemovex())
yrotate object 1,ry#
endif
position object 2,limb position x(1,ls),limb position y(1,ls),limb position z(1,ls)
rotate object 2,limb angle x(1,ls),limb angle y(1,ls),limb angle z(1,ls)
if spacekey()=1 then move object 1,-0.05
set cursor 0,0
for l=0 to max_limbs
if limb exist(1,l)=1
l$=limb name$(1,l)
if l=ls
ink rgb(255,0,0),0
else
ink rgb(255,255,255),0
endif
print str$(l)+": "+l$
endif
next l
center text 320,460,"Esc to exit"
sync
loop
delete object 1
delete object 2
end
I'd really appreciate it if someone would try this in patch 4.1 and let me know if the mesh deforms around the bones
and here's a rigged model to test it with if you don't have one, so there's no excuse!!
http://www.freewebs.com/danmatsuma/testc.x
Just save the stoopid cylinder in the same directory as the project, start the program type:
testc
or the name of an .x model of your own which has no animation data
then try scrolling through the joints/limbs/bones whatever you want to call them (rightclick) and then leftclick/drag the mouse to attempt realtime deformation of the mesh.
Move the mouse left/right without clicking to rotate the model.
Press space to move the model.
Please take note if the limbs move with the model (I know bone 0 does, but I'm interested in the others
)
Of course you can always just use it as a stoopid model viewer too
ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.