Procedural Animation Experiment #1, Spider
This Procedural rig was done using some standard rigging methods and some controllers that I've programmed in C++: distance constraint (measures the distance traveled by an object), projection constraint (projects the position of an object over the surface of a mesh) and follow constraints (set the rotation of an object to look at the direction of the path traveled by other object).
The animator only have to set the path of the spider. The body and legs movements are calculated by the rig in real time. The animator can also define a surface where the spider needs to walk over, can also define the length and the height of the steps, the amplitude of the body movement and its frequency.
This is how its working by now:
The animator only have to set the path of the spider. The body and legs movements are calculated by the rig in real time. The animator can also define a surface where the spider needs to walk over, can also define the length and the height of the steps, the amplitude of the body movement and its frequency.
This is how its working by now:
After programming some controllers in C++ for 3ds max i put them in test with a procedural animation exercise. the challenges in this kind of setup were pretty interesting because you have to deal with history dependency, this means: "values that depend of what had happened before in the timeline", in order to define the step cycle percentage per each leg the distance traveled by the spider needs to be calculated, this value depends of the path that the spider have traveled before, so... if we are in frame 1000 all the distance traveled before have to be calculated per each frame, that's not very convenient if we need to calculate that distance several times. Other values can become history dependent as well.
I have watched some people doing this kind of setups and they come up with a non real time solution: first, the path of the spider is defined by the animator, and then, when that process is finished all the procedural animation of the spider is calculated, like a physic simulation, first the animator establishes the basic conditions for the animation and then all the stuff is calculated. But in this exercise i wanted a real time solution, all the movements of the spider are calculated real time while the animator is defining the path of the spider.
The distance value can become history independent if the previous calculated distance is stored and used in the current calculation (distance in frame 2 is equivalent to distance within frame 1-2 and the previous calculated distance that lays within frame 0-1), it's a very good solution for real time previews but it have some problems:
-If the render is done in several machines there is no way to know the previous calculated distance from one machine to another.
-The calculated distance is not correct if the time slider skips several frames at once, for example, If the time slider jumps from frame 1 to frame 100 all the path traveled within those frames is ignored, the distance is calculated only using the position in the 1st and the 100th frame.
The way to avoid the first problem is to store the distance of each frame in variables or keyframes (baking the animation), the distance controller that i programmed has an option that enables the automatic bake of the distance values before any render is done. And about the second issue, it's not a big deal, because the distance is used to define a cycle (the legs cycle) being in a different percent of that cycle is not problematic unless the animator needs to know exactly the position of a leg in a specific frame. If that happens the distance has to be baked.
Well... that's it by now, i'll be sharing more insights in futures experiments.
I have watched some people doing this kind of setups and they come up with a non real time solution: first, the path of the spider is defined by the animator, and then, when that process is finished all the procedural animation of the spider is calculated, like a physic simulation, first the animator establishes the basic conditions for the animation and then all the stuff is calculated. But in this exercise i wanted a real time solution, all the movements of the spider are calculated real time while the animator is defining the path of the spider.
The distance value can become history independent if the previous calculated distance is stored and used in the current calculation (distance in frame 2 is equivalent to distance within frame 1-2 and the previous calculated distance that lays within frame 0-1), it's a very good solution for real time previews but it have some problems:
-If the render is done in several machines there is no way to know the previous calculated distance from one machine to another.
-The calculated distance is not correct if the time slider skips several frames at once, for example, If the time slider jumps from frame 1 to frame 100 all the path traveled within those frames is ignored, the distance is calculated only using the position in the 1st and the 100th frame.
The way to avoid the first problem is to store the distance of each frame in variables or keyframes (baking the animation), the distance controller that i programmed has an option that enables the automatic bake of the distance values before any render is done. And about the second issue, it's not a big deal, because the distance is used to define a cycle (the legs cycle) being in a different percent of that cycle is not problematic unless the animator needs to know exactly the position of a leg in a specific frame. If that happens the distance has to be baked.
Well... that's it by now, i'll be sharing more insights in futures experiments.