Hi Dominik (and others who are interested)
Following Andreas' adwice I added a new animVRMLSceneFileType to the
library, which means that animations are loaded when loading wrl files
with the SceneFileHandler (nice and easy :-)), eg.
NodePtr file = OSG::SceneFileHandler::the().read(filename.c_str());
To further activate the animations you have to use the Animator as
previously, eg.
Animator *pAnimator = new Animator();
bool do_animation = pAnimator->init(file);
...
if (pAnimator && do_animation)
pAnimator->start();
Actually you should be able to load several wrl files containing
animations and then do pAnimator->init(root) on the root node of the
entire scene (this is untested though).
The updated lib and example is here:
http://www.vrmedialab.dk/~rasta/personal/projects/libOpenSGVRMLAnimation.html
I hope that makes life a bit easier for you :-)
/Rasmus
On Thu, 2004-11-25 at 10:18, Andreas Zieringer wrote:
> Rasmus Agerholm wrote:
>
> > Hi Dominik
> >
> > On Tue, 2004-11-23 at 15:20, Dominik Rau wrote:
> >
> >>Hi Rasmus.
> >>Some time went by since I wrote the last time. The reason is, that your
> >>library just works and works and works.....
> >
> >
> > Nice to hear :-)
> >
> >
> >
> >>But there's one thing I can't really solve here, maybe it is already
> >>solved or you've got a cool idea about that (I'm sure you have ; )). As
> >>you know, I've got a virtual fishtank, with a lot of fishes (aka wrl
> >>Files with coordinate interpolators), often of the same type. Is there a
> >>way to
> >>
> >>* load gzipped wrl Files? The SceneFileHandler is able to do this, how
> >>can this be achieved with your lib (I load my models like in your
> >>testApp....)
> >
> >
> > Well, I guess basically the SceneFileHandler can be used if we can get
> > hold of the VRMLLoader of the VRMLSceneFileType and initialize my
> > VRMLAnimator with that... but that means altering OpenSG source files to
> > ad a getLoader() to the VRMLSceneFiletype. Maybe Gerrit will make that
> > change?
> >
> > Another possibility: I think it would possible to create a
> > MyVRMLSceneFileType inherited from VRMLSceneFiletype, which overrides
> > Gerrits VRMLSceneFileType. This is probably the best solution, which I
> > haven't looked much into. Maybe I should... I guess that there's is
> > always only one SceneFileType of each kind. So a MyVRMLSFT could create
> > a VRMLAnimator object and make it available by a getAnimator() method?
> > Dirk, Gerrit, Andreas can any of you comment on this?
>
> Yes that works I do the same in my app there is a special
> override/overridePriority flag in the SceneFileType constructor.
>
> const char *vrVRMLSceneFileType::_suffixA[] = { "wrl" };
>
> vrVRMLSceneFileType vrVRMLSceneFileType::_the(_suffixA,
> sizeof(_suffixA),
> true,
> 10);
>
> >
> >
> >>* copy already loaded (zipped or not) Files so that all cores except
> >>TimeSensors and GeoPositions are shared with the original (I need it
> >>this way to control my animations independently)? At this very moment I
> >>just load them x times and use a SharePtrGraphOp, which is kind of weird
> >>by principle and needs a lot of RAM and time.... I tried the cloneTree
> >>Methods, but it seems that the TimeSensor isn't shared.
> >
> >
> > cloneTree does not share anything AFAIK, it creates a copy of the tree.
> > So no shared node cores is expected :-)
>
> Well cloneTree shares all cores only deepCloneTree really duplicates
> everything.
>
> > I don't think it's possible to decouple the geoPositions from the
> > Geometry core. Actually I think that you can't really share much if your
> > goal is to control the animations independently. If you don't use
> > CoordinateInterpolators it should be possible to share the Geometry
> > cores. But you can't share interpolators or the transforms they
> > manipulate, because then you would essentially only have one animation.
> > So there's not much left to share (of the animation cores).
> >
> > Sorry, that didn't help much I guess :-(
> > /Rasmus
> >
> >
--
Rasmus Agerholm
Research Assistant
VR Media Lab (+45) 9635 8792
Niels Jernes Vej 14
DK-9220 Aalborg
Phone: (+45) 9635 8784
Fax: (+45) 9815 2444
http://www.vrmedialab.dk/~rasta
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users