| | |
Ten Thousand Animations, Curses!
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 1
Reputation:
Solved Threads: 0
I'm afraid this might be more of a WPF question instead of a C# question, but I'll ask it here and hope for the best:
I'm creating a system that generates images algorithmically and assembles them into a character. That part works fine: I end up with an image for the body, an image for the upper arm, an image for the forearm, etc.
To animate these images, I'm using transforms with animations applied to them. So the upper arm would have "RotateTransform upperArmRotate", which would then have a "DoubleAnimation" applied to it to rotate it. The lower arm would have the exact same transform - not a duplicate, the exact same one - which keeps it rotated the right amount. By ordering the translate and rotate transforms correctly, it even stays attached to the end of the arm just fine.
However, if I want to BEND the arm, I have to apply another animation to the lower arm, and create another rotate transform to animate. That one would apply just to the lower arm and hand.
As you can see, animating a detailed walk uses perhaps two dozen animations and transforms of various kinds. The problem isn't slowdown, though: it's changing animations.
What I'm doing is animating each step independently, allowing me to have generative animations based on posture and obstacles and so forth. All of the animations take the same amount of time - maybe one second for one, casual step - and then I want to apply new animations.
Right now, I trigger when the animation ends and try to apply new animations. However, the system interferes in an awkward place: the old transforms are still there, but are owned by a different thread (another animation thread? I don't know how that works, I can't find a clear explanation with my Google-fu) so I can't access them. I can't apply new animations to them, I can't kill them, I can't even stack on top of them, because trying to transform a point through a transform owned by someone else causes this error, and I need to manually transform points in order to correctly add transforms.
I bounced it off my friend, and he says it sounds like I'm going about it the wrong way, but didn't have any suggestions. How about any of you? At the very least, does anyone have a link to a tutorial on this kind of thing?
-Craig
I'm creating a system that generates images algorithmically and assembles them into a character. That part works fine: I end up with an image for the body, an image for the upper arm, an image for the forearm, etc.
To animate these images, I'm using transforms with animations applied to them. So the upper arm would have "RotateTransform upperArmRotate", which would then have a "DoubleAnimation" applied to it to rotate it. The lower arm would have the exact same transform - not a duplicate, the exact same one - which keeps it rotated the right amount. By ordering the translate and rotate transforms correctly, it even stays attached to the end of the arm just fine.
However, if I want to BEND the arm, I have to apply another animation to the lower arm, and create another rotate transform to animate. That one would apply just to the lower arm and hand.
As you can see, animating a detailed walk uses perhaps two dozen animations and transforms of various kinds. The problem isn't slowdown, though: it's changing animations.
What I'm doing is animating each step independently, allowing me to have generative animations based on posture and obstacles and so forth. All of the animations take the same amount of time - maybe one second for one, casual step - and then I want to apply new animations.
Right now, I trigger when the animation ends and try to apply new animations. However, the system interferes in an awkward place: the old transforms are still there, but are owned by a different thread (another animation thread? I don't know how that works, I can't find a clear explanation with my Google-fu) so I can't access them. I can't apply new animations to them, I can't kill them, I can't even stack on top of them, because trying to transform a point through a transform owned by someone else causes this error, and I need to manually transform points in order to correctly add transforms.
I bounced it off my friend, and he says it sounds like I'm going about it the wrong way, but didn't have any suggestions. How about any of you? At the very least, does anyone have a link to a tutorial on this kind of thing?
-Craig
![]() |
Other Threads in the C# Forum
- Previous Thread: Accessing data from Dynamically created textboxes
- Next Thread: save all task
| Thread Tools | Search this Thread |
.net access algorithm animation array barchart bitmap box broadcast c# check checkbox client code combobox control conversion csharp custom database datagrid datagridview dataset datastructure datetime degrees development directrobot draganddrop drawing encryption enum event excel file form format forms function gdi+ hash httpwebrequest image index input install java label lisp list listbox mandelbrot math mouseclick mp3 mysql native operator packaging path photoshop picturebox pixelinversion post print process programming radians regex remote remoting richtextbox safari server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser wfa windows winforms wpf xml





