I will ask you to share some thoughts about how to implement animation support in some open GL applications. For example, if we want something in the case of a user removed from the input, then animate the ball particle on the screen, why do we need to organize our code? :
- Set the Animation property like a member of the ball particle object? (It has a set of metrics to apply to the owner's model, there is a delay between them, whether playback animation happens or not ..)
- There is a need to keep some central stores in which the ball Does the connection between particle and animation apply to it (I, honestly, would like this one)?
- Something else ...?
And what about a rendering? How to make this fluid faster? (I know that it is very sensitive, but just give an idea ..)
I Define animation class, which can implement the following animation:
- Rotation / translation / scale animation
- Key frame animation
- Skinning Animation
Of course, one of the animation techniques listed above needs some general access to the object class.
Roto translation animation requires access to object model view metrics; Keyframe animation requires access to model corner buffs; Skiing animation requires access to the rendering status of the object (shader attributes and programs, or exquisite properties using Extentax).
In addition to skinning, the interpolation will be implemented with normal values (floats, vector or matrix), so that the values can be changed using the interpolation formula (good linked by GenpiFault). Therefore an interpolator class will be able to reduce the introduction of new interpolation equations.
Animation uses a set of example interpolator to perform class animation (changing changing values) how to select value in the class object Gone, access and modified (categories) will be defined.
There should be an timeline class at this point time has passed (which can not be real), which is the animation example (or perhaps the single Interpolator Examples) make interpolated values in advance for the intermediate value.
animation example is queued on the timeline class, so it knows which animation example is active internally generated Use of events can be activated due to user input or program. To eliminate the animation execution, the animation class can define the IsTerminated method the timeline example (perhaps < Em> animation can loop back the animation for continuous animation).
Of course everything depends on your actual needs.
In this case, the computation of animation can take a long time, you can cache the whole model data and play the animation in a different thread. Once finished, the rendering loop can be blocked by the model.
However, I would consider inlining the animation processing by issuing appropriate data to the shader programs that allow a faster calculation, which can increase the system performance.
Comments
Post a Comment