Frame System

Andreas Zehender az at azweb.de
Thu Oct 5 23:00:31 CEST 2006


(just rough thoughts)
There is a base class for all objects that make animations. Say 
PMAnimationBase.
Base classes are
- PMScript
- PMPath
    - PMLinearPath
    - PMSplinePath
...

Each class has a method:
calculateFrame(double clock, double clockDelta, undoRedoManager)

That method is called for each frame, the animation object calculates 
some values and sets some properties of some object, and stores the 
changes in the undoRedoManager stack With that stack the animation can 
be traversed forward and backward.

So far the common part for scripts and pathes, now to the difference:

Alternative A) Scripts may change any property of any object, while 
pathes are bound to only a single object and a single property. A 3d 
spline path can be bound for example to corner1 or corner 2 of a box, or 
to a translate object inside the box. For each frame the path calculates 
a 3d point and sets the property to the point.

Alternative B) You just can set pathes to be used in a script. Only 
scripts may change properties, but can use a path to calculate a 3d point.
<script>
path=scene.namedObject("path for box1");
box=scene.namedObject("box1");
box.translate(0)=path.point(clock);
</script>

I tend to alternative B, in that case the above abstract class 
PMAnimationBase is not used for pathes, but may be useful later for 
something else ... uh ... I don't know yet ;-)


Miguel Angel Gómez Márquez schrieb:

> may i ask how do you have planned to make the box follow the spline?
> (a graphical spline)
>
>------------------------------------------------------------------------
>
>
>List archive and information: https://mail.kde.org/mailman/listinfo/kpovmodeler-devel
>



More information about the kpovmodeler-devel mailing list