Hi Carlo,
Carlo Orru wrote:
>
> Well, actually my first idea _was_ to handle the animation on the client,
> but since I decided it had to use a custom RenderAction method to change
> the Transform nodes' Cores I came up with the described solution...
> My initial idea was a client application able to:
> - Load a scene from a file
> - Register a custom callback via RenderAction::registerEnterFunction()
> in order to be able to process the nodes thus setting up the
> transformation matrices
> - Transmit the result to the server
>
> This didn't work as expected because my callback was never executed by the
> client, since all the rendering stuff was done by the server and I didn't
> want to call the traverse() method on the client every frame.
> So, to answer your final question: I don't believe at all that my approach
> is the simplest, but it was the first one that came to my mind ! ;-)
Ah, ok, so you wanted to do the animation as a side-effect of the normal
rendering traversal? That sounds like an intuitive and intriguing idea, but it
has some problems, too.
Pro:
- Simple to use: you render, things move.
- Can be efficient, as objects that are culled don't need to animate
Con:
- Doesn't work in the cluster. ;)
- Can be inefficient, as you have to test every object whether it needs to be
animated. In most scenes only a few objects are animated, or add special
versions of objects that are animated. But that means adding a lot of new
objects, and only allows a subset of the objects to animate.
- Cannot be done in a separate thread, as it's part of the rendering traversal.
- Synchronization can be difficult, as there can be many rendering traversals
that for any given frame (e.g. 2 for a stereo monitor, 12 for a 6-sided stereo
CAVE) that all have to show the same geometry for a consistent result.So
figuring out when to advance the animation is not trivial.
That's why most people on the list (or at least the ones that have talked about
it ;) prefer an approach where the animation is handled by a separate set of
classes outside the scene graph. Objects/attributes to be animated are
registered with an AnimationController and the application has to trigger teh
animation explicitly, but it can do that just before the rendering or in a
separate thread or on a separate computer if it really wants to.
Hope it helps
Dirk
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users