Hello again. Different problem this time, so different thread.

I believe there is a bug in node.c when evaluating node->scl from the
scl_track. It uses lib3ds_lin3_track_eval() which, if the track is
null, sets the scale to (0,0,0). It would be better if it defaulted to
(1,1,1) when no track exists.

Here's my patch, though I haven't tested it properly yet cos of my
build problems. I'm pretty sure it'll work though. FYI, Sketchup's 3ds
export tends to forget to put a scale track in the node. That's how I
spotted this.

RCS file: /cvsroot/lib3ds/lib3ds/lib3ds/node.c,v
retrieving revision 1.13
diff -u -r1.13 node.c
--- node.c      16 Nov 2004 07:41:44 -0000      1.13
+++ node.c      20 Jun 2006 13:39:54 -0000
@@ -283,7 +283,8 @@

         lib3ds_lin3_track_eval(&n->pos_track, n->pos, t);
         lib3ds_quat_track_eval(&n->rot_track, n->rot, t);
-        lib3ds_lin3_track_eval(&n->scl_track, n->scl, t);
+       if (!track->keyL) for (int i=2; i>=0; --i) n->scl[i]=1.0f;
+       else              lib3ds_lin3_track_eval(&n->scl_track, n->scl, t);
         lib3ds_bool_track_eval(&n->hide_track, &n->hide, t);
         lib3ds_morph_track_eval(&n->morph_track, n->morph, t);


Cheers,
Dave.


_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel

Reply via email to