R: [Plib-users] Loading ASE file
Brought to you by:
sjbaker
From: Paolo L. <p.l...@ci...> - 2000-05-24 13:31:14
|
Such complete answer from Steve offer the opportunity for arising an important quest for a better documentation for plib, and in particular for ssg as the most used library in the pool. The example is the method getByName() as shown at work in the Steve's code: ssgEntity *my_animation_node = root -> getByName ( "my_animation" ) ; Of course, not to mention, I wrote such a function by my own (in several variants, but for sure some graph structure would not be supported). Ok, it all goes in the experience knapsack, but many of you know how one feels when have worked on something already available (somewhere there, rather hidden, though). Stop there, Steve! I'm not asking you directly to write improved doc, nor anybody else in particular. I just want to say that plib, for the large interest that is going to draw, and for the quality code it relies upon, would deserve a better treatment on the doc side, and we should think about it just after 1.2. Greetings - Paolo > -----Messaggio originale----- > Da: pli...@li... > [mailto:pli...@li...]Per conto di Steve Baker > Inviato: mercoledì 24 maggio 2000 14.13 > A: pli...@li... > Oggetto: Re: [Plib-users] Loading ASE file > > > > Dave McClurg wrote: > > > > > I see that there is some form of animation in the ase loader. > > > How can I use this. Like play the animation back once its loaded? > > Well, *if* they were supported by the loader, then you'd attach > a textual name to the object in the modeller (dunno how you do > that in ASE files - but that kind of thing is generally > quite easy in most modellers). Then you can load the model > and using the 'root' node that the loader returned: > > root = ssgLoad ( "my_file.ase" ) ; > > ... > > ssgEntity *my_animation_node = root -> getByName ( "my_animation" ) ; > > if ( my_animation_node == NULL ) > fprintf ( stderr, "My_animation is missing!\n" ) ; > else > if ( ! my_animation_node -> isAKindOf ( ssgTypeTimedSelector () ) ) > fprintf ( stderr, "My_animation *isn't* an animation?!?\n" ) ; > else > { > ((ssgTimedSelector *)my_animation_node) -> control > SSG_ANIM_START ) ; > ...or whatever... > } > > > ssgSelector and its derivations only support up to 32 frames. > > That limits what could quickly be done with MESH_ANIMATION. > > But MESH_ANIMATION is much more convenient than managing multiple > > shapes as files and should be added to PLIB as soon as needed. > > We need to do something about that. I'd originally only intended > ssgSelector to be a simple switch-like mechanism - and the idea for > an ssgTimedSelector came along much later. There are ways to fake > an animation with more kids than that yourself using callback functions. > > The folding paper demo I posted a week or so ago has HUNDREDS of > animation steps - implemented by pointing an ssgBranch node at a > different child node each frame in the application code. Not > elegant - but it *does* work. > > It should be quite easy to fix ssgSelector to have more child nodes, > we just need to be careful to preserve the current API for people > who don't need more than 32 nodes. > > -- > Steve Baker http://web2.airmail.net/sjbaker1 > sjb...@ai... (home) http://www.woodsoup.org/~sbaker > sj...@ht... (work) > > _______________________________________________ > plib-users mailing list > pli...@li... > http://lists.sourceforge.net/mailman/listinfo/plib-users > |