Re: Frame System
Andreas Zehender <[email protected]> Thu, 05 Oct 2006 23:00:31 +0200
| Newsgroups | gmane.comp.kde.devel.kpovmodeler |
|---|---|
| Message-ID | <[email protected]> |
(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=3Dscene.namedObject("path for box1");
box=3Dscene.namedObject("box1");
box.translate(0)=3Dpath.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=F3mez M=E1rquez 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/kpovmo=
deler-devel
>
List archive and information: https://mail.kde.org/mailman/listinfo/kpovmod=
eler-devel