Re: [Plib-users] Loading ASE file
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-05-24 12:10:16
|
> 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) |