Animation
Moderator: Moderators
Animation
A attempt at putting together a animation road-map for ZGE. First off, a quick overview of the most prominent concepts.
---
F-Curve ( Function Curve )
A F-Curve is a 1D curve generated from a number of control points. Each point is indexed by its frame ( time-stamp ) and holds a value + 2 tangents.
Visual representation of a F-Curve
Tree
A hierarchical tree ( parent-child relation ) provides a framework to simplify animating individual entities that influence each other.
Visual representation of a hierarchical tree
FK ( Forward Kinematics )
FK is the default hierarchical behavior causing a "parent" to forward transformations to its "children".
IK ( Inverse Kinematics )
IK is a hierarchical behavior that causes a "child" to influence its "parent" ( influence can be multiple levels deep ).
Morph
Morph is a technique for deforming a mesh from one shape into another. Each shape ( aka morph-target ) contains the relative translation of all affected vertices.
Single morph-target applied 100%
Bone
A bone is a basically a special purpose transformation matrix.
Skin
Skin ( aka Envelope ) is a technique to deform a mesh based on a bone-structure. The mesh requires a Weight-Map which connects each vertex to a number of bones at a certain percentage ( total of 100% ).
Visual representation of a Weight-Map
K
Maybe we could start with the simplest and most versatile feature .. F-Curves. Personally I think it would be good to keep things consistent and go with a approach like this.
Additionally you would need a AnimatorCurve Component that has a Curve + Target property ( like AnimatorSimple ) and make it compatible with the Animators node of AnimatorGroup.
This also leaves room for CurveImport, CurveExpression etc.
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
great
Nice summary Kjell!
It would be great if we do keep things consistant with the current paradigm, implementing the vaious elements as individual components, that work well to together,. in this way, they will have many uses unstead of one. That Curve editor setup looks smashing!
It would be great if we do keep things consistant with the current paradigm, implementing the vaious elements as individual components, that work well to together,. in this way, they will have many uses unstead of one. That Curve editor setup looks smashing!
iterationGAMES.com
Hi jph,
The idea of the new design is to have component specific editors in the bottom panel only* For example, when you have a Model that renders some geometry based on a Array, you can lock the preview onto the Model, but have the Array selected ( so you get the Array properties + editor ).
*Unlike the Sound / Graph Editor right now.
K
Thanks ~ It's not meant to be a editor though, just a visual previewThat Curve editor setup looks smashing!
The idea of the new design is to have component specific editors in the bottom panel only* For example, when you have a Model that renders some geometry based on a Array, you can lock the preview onto the Model, but have the Array selected ( so you get the Array properties + editor ).
*Unlike the Sound / Graph Editor right now.
K
- Attachments
-
- Array.png (54.74 KiB) Viewed 12971 times
Good initiative Kjell and very nice with illustrations as well.
The Curve idea is excellent as it would be simple to use for things such as camera paths too. I believe it could be implemented quite quickly and I will start looking at this right away.
Just so I understand how we can take the next step after that, do you have any suggestion on how the Curve-component could be used for animating a mesh? Some sort of AnimateMesh-component that has Curve and Mesh properties maybe? Or simply using AnimateCurve to modify properties of a RenderTransform on different subtrees in a Model.OnRender?
The Curve idea is excellent as it would be simple to use for things such as camera paths too. I believe it could be implemented quite quickly and I will start looking at this right away.
Just so I understand how we can take the next step after that, do you have any suggestion on how the Curve-component could be used for animating a mesh? Some sort of AnimateMesh-component that has Curve and Mesh properties maybe? Or simply using AnimateCurve to modify properties of a RenderTransform on different subtrees in a Model.OnRender?
Hej Ville,
K
As long as you don't mean "paths" as in splines. Keep in mind that FCurves are basically 1D, so the X property of In can never be lower then 0, and X of Out never higher then 0.The Curve idea is excellent as it would be simple to use for things such as camera paths too.
When animating a mesh using skinning, you're actually animating the underlying bone structure. So as soon as we've got hierarchy + bone ( + skeleton container ) support, we can start thinking about how to simplify assigning curves to various bone properties ( same thing with Morph )Do you have any suggestion on how the Curve-component could be used for animating a mesh?
K
I'm using this ..
Code: Select all
float solveCurve(int C, float T)
{
float X1, Y1, X2, Y2, X3, Y3, X4, Y4, A, B, X, Y;
if(Curve[C,CurveKey[C],0] > T)
{
CurveKey[C] = 0;
}
while(Curve[C,CurveKey[C]+1,0] < T)
{
++CurveKey[C];
}
X1 = Curve[C,CurveKey[C] ,0];
Y1 = Curve[C,CurveKey[C] ,1];
X4 = Curve[C,CurveKey[C]+1,0];
Y4 = Curve[C,CurveKey[C]+1,1];
X2 = Curve[C,CurveKey[C] ,4]+X1;
Y2 = Curve[C,CurveKey[C] ,5]+Y1;
X3 = Curve[C,CurveKey[C]+1,2]+X4;
Y3 = Curve[C,CurveKey[C]+1,3]+Y4;
B = (T-X1)/(X4-X1);
A = 1-B;
X = X1*A*A*A+X2*3*A*A*B+X3*3*A*B*B+X4*B*B*B;
B = (X-X1)/(X4-X1);
A = 1-B;
Y = Y1*A*A*A+Y2*3*A*A*B+Y3*3*A*B*B+Y4*B*B*B;
return Y;
}
Kjell, can you please rewrite your solveCurve in pseudo code indicating what the different array values correspond to.
Such as:
etc. I'm not sure I will get it right otherwise
Such as:
Code: Select all
TCurvePoint = class
Frame,Value : single;
InX,InY,OutX,OutY : single;
end;
...
var
P1,P2 : TCurvePoint; //The two points in the current interval
...
X1 := P1.InX;
@Ville : Ehm, the confusion is probably caused by the fact that it's basically 2 functions in 1.
The first part determines which 2 points should be used for the calculation. Because I'm generally using animations with hundreds of points ( and don't need backward playback ), I keep a array ( CurveKey ) that holds at which point the animation is currently ( so I don't have to loop through all the points from the start every frame ).
Anyway, the actual curve solving part starts at "B = (T-X1)/(X4-X1)" .. this illustration should clear things up.
P1 represents X1&Y1, P2 = X2&Y2 etc
The first part determines which 2 points should be used for the calculation. Because I'm generally using animations with hundreds of points ( and don't need backward playback ), I keep a array ( CurveKey ) that holds at which point the animation is currently ( so I don't have to loop through all the points from the start every frame ).
Anyway, the actual curve solving part starts at "B = (T-X1)/(X4-X1)" .. this illustration should clear things up.
P1 represents X1&Y1, P2 = X2&Y2 etc
@keymasher : There's a long and a short answer to that .. the short answer being "no"sounds fairly heavy no?
Thanks for the explanation. First implementation checked in now. Nothing visual, just the basic components.
http://www.zgameeditor.org/files/ZGameEditor_beta.zip
http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Attachments
-
- CurveTest.zgeproj
- test project
- (725 Bytes) Downloaded 681 times