Moving from one frame to another does not change the mesh(except for morphs). However visiblity is keyframeable. One node to one mesh is how the PLAYER.C works...but nodes have a heirarchy pointing to children, and thus multiple meshes are drawn starting at one node. So I can load my character composed of legs, arms, head, etc....which is animated. Player.c looks for all the root nodes...which is the waist of my character, finds the furthest leaf node, and positions & rotates it... say the feet, then looks at the parent of this node such as the lower legs and positions and rotates...etc...this is a recursive process until the root node is reached again (the waist). It's kinda backwards feeling, but that's how OpenGL likes it.
For... say a weapon... I would suggest linking it to the character in the artwork, and then only drawing it when you want. If you want the weapon to be a standalone object you'll need to link it in code rather than in the artwork output. I personally, would do the later and not try to sort out the lib3ds node mechanisms for adding and deleting nodes. Just call it's drawing routine after drawing the hand node of the "character" mesh, before changing your matrix.. The pivot points will line up. What is your hardware setup? You can > So only the matrix will be changed, if you move to a new frame right?But > that makes it impossible to have the scene changed(in example, in frame 2 > a > weapon is added) right? > > My main reason to use my own structures(classes to be precise) was that > rendering 60000+ polygons got really slow, and now i'm trying to optimize > my > rendering code as much as possible. Collision detection wouldn't be sucha > a > big deal, because I only need a couple of vertices per node(4 if i'm > correct). > > And I have a final question: The source code of player.c makes it look > like > a node can hold a maximum of one mesh because it gets the mesh using > lib3ds_file_mesh_by_name([..]). I always thought that a node could contain > more than just one mesh(that a node was to group meshes). > Merry XMas, > Hylke > > ======================================================= > > Merry Christmakah, > > Case 2, which requires more "memory" (Case 1, rebuilding the mesh for > every frame should only be done for morhping)...Case 2 requires memory > allocated per keyframe and in-betweening is interpreted based on the tcb > data. > > I have done what you have basically described you want to do, I use > lib3ds to drive my animation, but at render time I call my 3DS > structures. > I haven't bothered to strip out the mesh definations from loading 3ds > into lib3ds, so I waste some memory by storing the mesh twice (as my > custom structure and a as a lib3ds structure). I will tell you > this...lib3ds has a very poor implementation of materials/shaders...and I > am glad I don't use lib3ds structures for that. > > It sounds like you want to get the final vertex positions in "world" > coordinates after all the animation matrices have been applied? for > collision detection? > > > > Hello, > > I'm currently writing some classes to store the 3ds information on my > own > > way, so I can improve rendering performance. > > But I have a small question regarding frames. How are they handled? Is > it > > like: > > If the current frame is changed(using the function > lib3ds_file_eval([..]); > > ), then update all nodes, meshes, faces, point etc., so that it's > basicly > > a > > new model. > > Or is it like: > > The same model, but with only the matrix of the meshes changed? > > Because if it's the last case, then I would need to allocate quite a > lot > > memory. > > I hope somebody can tell me how it's done. > > Thanx in advance, > > Hylke > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > > files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > _______________________________________________ > > lib3ds-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/lib3ds-devel > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > lib3ds-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/lib3ds-devel > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > lib3ds-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/lib3ds-devel > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ lib3ds-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lib3ds-devel
