Quote: "I think I may have to port all this over to GDK after all..."
Unless you want to, but I don't think it's necessary.
If you are playing the entire animation and you want there to be an axis object on each limb at the time of playing, then I can see it being a bit tricky - unless you use your quat to euler to get the correct angles of the limbs. Then no problem!
But, I assume the axis object is for identifying which limb you are rotating (to set up the animation) and supply a visual aid of that rotation and limb selection. If you have a hand on an arm, and you rotate the arm, if the limbs are linked, the hand will be at a new position. This is the cue that identifies the hierarchy. If you do a check through the limbs and match their old position to any new positions after the rotation of a single limb is made, you'll end up with the child limbs to rotate to match the parent limb. And remember, hopefully you've created an array to store each keyframe rotation of a limb, so if you rotate a parent, once you find the limbs whose position(s) have changed, you apply the parent rotation + whatever angles the child was rotated previously (stored for the axis object), and apply that rotation to the axis object.
This example expands a bit on the last one. It's a little clumsy, but it shows the idea. The crosses represent the axis pointers. A little work would streamline the code:
rem object to limb orientation 2
rem by latch
rem 09/26/2008
set display mode 800,600,32
sync on
sync rate 60
autocam off
make object sphere 1,25
make object box 2,25,5,5
offset limb 2,0,12.5,0,0
make mesh from object 2,2
delete object 2
add limb 1,1,2
add limb 1,2,2
add limb 1,3,2
delete mesh 2
link limb 1,2,1
link limb 1,3,2
color limb 1,2,rgb(255,0,0)
color limb 1,3,rgb(0,255,0)
offset limb 1,1,12.5,0,0
offset limb 1,2,25,0,0
offset limb 1,3,25,0,0
rem crisscross planes as axis
make object plain 3,5,20
make mesh from object 3,3
add limb 3,1,3
rotate limb 3,1,0,0,90
rotate limb 3,0,0,90,0
delete mesh 3
make mesh from object 3,3
delete object 3
make object 3,3,0
make object 4,3,0
set object 3,0,1,0
set object 4,0,1,0
delete mesh 3
`set object rotation zyx 3
position camera 0,0,-100
rem get the number of limbs
perform checklist for object limbs 1
lmbcount=checklist quantity()
empty checklist
rem let's create an array to hold all of the limbs positions
rem and let's create an array to hold the axis object(s)' rotations
dim lmb#(lmbcount,2)
dim axis#(lmbcount,2)
axis#(3,0)=120
axis#(3,1)=0
axis#(3,2)=60
rotate limb 1,3,axis#(3,0),axis#(3,1),axis#(3,2)
do
rem the angles to rotate
xang#=wrapvalue(xang#+.5)
yang#=wrapvalue(yang#-2)
zang#=wrapvalue(zang#+1)
rem get the limbs' initial position(s) (except the one you are rotating)
cur=2
for lm=1 to lmbcount
if lm <> cur
lmb#(lm,0)=limb position x(1,lmb)
lmb#(lm,1)=limb position y(1,lmb)
lmb#(lm,2)=limb position z(1,lmb)
endif
next lm
rotate object 1,xang#,yang#,zang#
rotate limb 1,2,xang#,yang#,zang#
rem rotate the axis to the limb...
set object to object orientation 3,1
pitch object down 3,object angle x(1)
turn object right 3,object angle y(1)
roll object left 3,object angle z(1)
pitch object down 3,xang#
turn object right 3,yang#
roll object left 3,zang#
rem store the pointer's angles in the array
axis#(cur,0)=object angle x(3)
axis#(cur,1)=object angle y(3)
axis#(cur,2)=object angle z(3)
rem now check if any limbs have been displaced. If they have
rem then those are the pointers to rotate relative to the parent and the root.
for lm=1 to lmbcount
if lm <> cur
if (limb position x(1,lm) <> lmb#(lm,0)) or (limb position y(1,lm) <> lmb#(lm,1)) or (limb position z(1,lm) <> lmb#(lm,2))
rem you should include the identifyer of the axis pointer in the array
rem so it's easy to associate it with the limb, but I know I'm using object 4
rem so I'll just hard code it
set object to object orientation 4,3
pitch object down 4,axis#(lm,0)
turn object right 4,axis#(lm,1)
roll object left 4,axis#(lm,2)
endif
endif
next lm
rem position the pointers on the limbs
position object 3,limb position x(1,2),limb position y(1,2),limb position z(1,2)
position object 4,limb position x(1,3),limb position y(1,3),limb position z(1,3)
sync
loop
Enjoy your day.