D
Darren
X-No-Archive
Hi all,
Can anyone help me with structuring the data in a small tool I have to
build? I'm trying to work out if there's a design pattern or data
structure that would remove some of the dependencies.
I am designing an animation tool.
A /Character/ is easily represented by a tree, each node of which
delegates to a vector. A skeleton or stickman can therefore be
described.
Any number of /Poses/ (or Keyframes) can be defined, each of which is
an angle for each joint in the Character. A Pose can therefore be
stored using a tree, each node of which delegates to an Integer, which
is the angle for that joint.
Here we have the first problem: each Pose (there won't be less than 50
Poses) requires storing a tree of the same structure as the Character.
If the Character's structure changes, every Pose needs to be explicitly
notified of this change.
Any number of /Animations/ may be defined. These are a list of Poses
(the same Pose may be used in any number of Animations).
Here we have my second problem - do I index or reference the Poses?
Either way, if a Pose is deleted, every Animation will have to be
individually notified of the deletion, so that the integrity of the
Pose list in the Animation is kept.
In addition, each Animation has an /Interpolation/ for each pair of
Poses in the list. This may be a set of Beziers, one for each joint in
the Character. These can be stored in a tree, each node of which
delegates to a Bezier object which describes the motion curve for that
joint, but this is the same as my first problem: each Interpolation
requires storing a tree of the same structure as the character.
I have looked at organising this data differently: one method would be
for each node in a Character's tree to delegate to a Joint object, each
of which contains a list of angles, one for each Pose in the system -
but this scatters the discreet notion of a 'Pose' into an "index into
many joints' Poses list".
If it's a choice between the two techniques, I've tried the latter and
I'm tempted to try the former, thinking that keeping a set of trees
following the same structure is the nicer of the two solutions.
I guess the ideal would be if the tree structures used by the Pose and
Animation objects somehow implicitly reflect the Character's tree, but
I'm not sure if this is possible - any ideas on this or other ways to
improve this design?
Many thanks,
Darren Grant
Hi all,
Can anyone help me with structuring the data in a small tool I have to
build? I'm trying to work out if there's a design pattern or data
structure that would remove some of the dependencies.
I am designing an animation tool.
A /Character/ is easily represented by a tree, each node of which
delegates to a vector. A skeleton or stickman can therefore be
described.
Any number of /Poses/ (or Keyframes) can be defined, each of which is
an angle for each joint in the Character. A Pose can therefore be
stored using a tree, each node of which delegates to an Integer, which
is the angle for that joint.
Here we have the first problem: each Pose (there won't be less than 50
Poses) requires storing a tree of the same structure as the Character.
If the Character's structure changes, every Pose needs to be explicitly
notified of this change.
Any number of /Animations/ may be defined. These are a list of Poses
(the same Pose may be used in any number of Animations).
Here we have my second problem - do I index or reference the Poses?
Either way, if a Pose is deleted, every Animation will have to be
individually notified of the deletion, so that the integrity of the
Pose list in the Animation is kept.
In addition, each Animation has an /Interpolation/ for each pair of
Poses in the list. This may be a set of Beziers, one for each joint in
the Character. These can be stored in a tree, each node of which
delegates to a Bezier object which describes the motion curve for that
joint, but this is the same as my first problem: each Interpolation
requires storing a tree of the same structure as the character.
I have looked at organising this data differently: one method would be
for each node in a Character's tree to delegate to a Joint object, each
of which contains a list of angles, one for each Pose in the system -
but this scatters the discreet notion of a 'Pose' into an "index into
many joints' Poses list".
If it's a choice between the two techniques, I've tried the latter and
I'm tempted to try the former, thinking that keeping a set of trees
following the same structure is the nicer of the two solutions.
I guess the ideal would be if the tree structures used by the Pose and
Animation objects somehow implicitly reflect the Character's tree, but
I'm not sure if this is possible - any ideas on this or other ways to
improve this design?
Many thanks,
Darren Grant