Hello All,

I'm building a little app using directors 3D bonesanimation.
I have a 3Dmodel that i can control the bones of. I have code that can
record the position of the model (saving bone nr and transform to a list). I
can then use this information to animate the model to any saved position
from any current position.
Now I want to save this information so I can use it the next time I start my
program. In the end it will be saved in a database (if possible), but for
now any method would do. I tried to save it with BA writeini and as text in
a textmember. But if I'm not mistaken, transform is an object and does
therefore not save, well the information is saved as
"transform(1.0000,0.000" etc...., but I cant get this information back into
director.
I have tried value and different variations of do but nothing I have tried
so far works. Has anyone done anything similar? How should I save this
information and retrieve it?
This is the code I use to save the transitions in the list pPositions:
-----
on PutPosition me
    global pPositions
    posTemp = []
    repeat with i in [2,3,4,6,7]
        tempT = pArm.bonesplayer.bone[i].transform
        temp = [i, tempT]
        add posTemp, temp
    end repeat
    add pPositions, posTemp
end
-----
Saving one position in the list could look like this:
-----
[[[2, transform(0.83867,0.00000,0.54464,0.00000,
0.00000,1.00000,0.00000,0.00000, -0.54464,0.00000,0.83867,0.00000,
0.00000,0.00000,0.00000,1.00000)], [3,
transform(0.99997,-0.00730,0.00000,0.00000, 0.00730,0.99997,0.00000,0.00000,
0.00000,0.00000,1.00000,0.00000, 0.00000,0.00000,0.00000,1.00000)], [4,
transform(0.99971,0.02396,0.00000,0.00000, -0.02396,0.99971,0.00000,0.00000,
0.00000,0.00000,1.00000,0.00000, -0.00000,-0.00000,0.00000,1.00000)], [6,
transform(1.00000,-0.00000,0.00000,0.00000, -0.00000,-1.00000,0.00000,0.0000
0, 0.00000,-0.00000,-1.00000,0.00000, 0.00000,0.00000,0.00000,1.00000)], [7,
transform(0.52456,-0.85138,0.00029,0.00000, -0.85138,-0.52456,-0.00016,0.000
00, 0.00029,-0.00016,-1.00000,0.00000, -4.65897,-8.34282,0.00282,1.00000)]]]
-----

Thanks in advance,
Martin Sandberg


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to