I think I found out what was the problem: node visitors skips any sub-graph
whose root has a nodemask = 0 ...did I understand it correctly? ...in this
case I understand the reason for my missing nodes...because at the beginning
of my simulation some nodes are hidden.

Is there a way to force the visitor to actually visit the entire graph?
...going down even if it finds a hidden node?

Thanks.
Alessandro


On 6/6/07, alessandro terenzi <[EMAIL PROTECTED]> wrote:

I just started using AnimationPathCallbacks so maybe, I'm asking silly
things, anyway, in the code I'm testing I have two 3D objects, each with its
AnimationPathCallback. Since the animation that I exported from 3dsmax is
too fast, I want to slow it down using the AnimationPathCallbacks methods.
To perform this task I created a visitor that search for nodes that have
an AnimationPathCallback and, for each, I set the time multiplier as needed.
But my problem is that everythings works fine if I perform this scene
visiting "after" the application has started and the scene displayed, but it
doesn't work if I do it "before" the application main loop. In particular
the visitor correctly returns every node with its callback in the first
case, but in the second case the visitor manage to find just one callback
and ignores the other.
I don't know exactly how AnimationPaths work and how they relate to
Viewers, but it looks like that I if perform my scene visiting just after
the realization of the viewer, then the behaviour is correct and I get every
node (with a callback) as I expected...

Am I doing something wrong?
Thanks.
 Regards.
Alessandro

On 6/5/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
>
> Hi Alessandro,
>
> You can control the start times of AnimationPathCallbacks.  In the SVN
> there a few better controls for this.
>
> If you do things programatically you might find it easier, i.e export
> your objects separately from 3DMax and then attach a single animation
> path to them both, or just attach the animation path to the viewer.
> For the later you can use the osgGA::AnimationPathManipulator, and
> apps like osgviewer even have support for reading from animation path
> files on the command line i.e.:
>
> osgviewer cow.osg -p myanimation.path
>
> Robert.
>
>
> On 6/5/07, alessandro terenzi <[EMAIL PROTECTED]> wrote:
> > Hi Robert,
> > thank you for your answer. You're right about the structure of my
> scene
> > graph: I have the planet's geometry under its Transform and
> > AnimationPathCallback nodes and I have the sphere under another
> Transform
> > with another AnimationPathCallback ... but I cannot follow your
> suggestion
> > to put the sphere under the planet's Transform because I need to keep
> them
> > separated (it would be difficult to explain the reason now :)
> >
> > I've never used AnimationPath, so I don't understand exactly the other
>
> > solution to attach the AnimationPath to viewers Camera...
> >
> > Anyway, not considering my specific problem, I think that in general
> the
> > problem may be formulated as follows:
> >
> > if I have a not visible node (whose nodemask is set to 0) and an
> > AnimationPathCallback that manages its animation, is there a way to
> let the
> > animation start even though the node is not visible yet? In this case
> when
> > the node will come visible the animation will eventually be in synch
> with
> > other animations in the scene...
> >
> > Thanks. Regards.
> > Alessandro
> >
> > On 6/5/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
> > > Hi Alessandro,
> > >
> > > For type of thinsg you are doing there are two main ways to
> animation
> > > things - to animate the camera path, or to animate the objects in
> the
> > > scene.
> > >
> > > I'm not familiar with 3DMax's export to the OSG so can't comment
> > > specifically on this, but I'd suspect its created an AnimationPath
> > > attached to a Transform which is above the planet, so the objects is
>
> > > moving  and the camera is stationary.  Then you have your
> transparent
> > > sphere, and I'd guess that this is not under the planets Transform
> > > node so isn't moved with it.
> > >
> > > To fix things you either need to put the sphere under the same
> > > Transform as the planet, or you need to attach the AnimationPath to
> > > viewers Camera.
> > >
> > > Robert.
> > >
> > > On 6/5/07, alessandro terenzi <[EMAIL PROTECTED]> wrote:
> > > > I'm experiencing the following problem:
> > > >
> > > > I exported a model from 3dsmax to OSG, the model consist of 2
> objects:
> > > >
> > > > - a planet that is animated in order to follow a circular path
> > > > - a semi-transparent sphere linked to the planet (its purpose, in
> OSG,
> > > > should be to highlight the planet when the mouse move over the
> planet)
> > > >
> > > > So, in 3dsmax, I linked the sphere to the planet, because it
> should
> > follow
> > > > the animated planet. In my OSG application the planet is shown
> from the
> > very
> > > > beginnig of the application, and it starts following the path
> > immediatly. On
> > > > the other hand, I chose to hide the sphere (setting the
> corrensponding
> > > > nodemask to 0x00000000) until the mouse moves over the planet, but
> I see
> > > > that when that event occurs, the sphere is shown (I set nodemask
> to
> > > > 0xFFFFFFFF) but not in the same position of the planet (as I
> expected).
> > I
> > > > mean that the sphere follows the same path as the planet but it
> seems
> > that
> > > > the animation started just when I unhid the sphere, so it is late
> with
> > > > respect to the planet...
> > > >
> > > > How can I solve the problem? Is it related to the fact that I'm
> > > > hyding/unhyding using the nodemask?
> > > > Is there a way to let the animation start even though the
> corresponding
> > node
> > > > is not visible?
> > > >
> > > > Thanks!
> > > > Regards.
> > > >
> > > > Alessandro
> > > > _______________________________________________
> > > > osg-users mailing list
> > > > [email protected]
> > > > http://openscenegraph.net/mailman/listinfo/osg-users
> > > > http://www.openscenegraph.org/
> > > >
> > > _______________________________________________
> > > osg-users mailing list
> > > [email protected]
> > > http://openscenegraph.net/mailman/listinfo/osg-users
> > > http://www.openscenegraph.org/
> > >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to