Patches item #1539617, was opened at 2006-08-13 13:06 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=304041&aid=1539617&group_id=4041
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Reed Hedges (reed) Assigned to: Nobody/Anonymous (nobody) Summary: Fix coordinate "mirroring" in player (fix bug 1077795) Initial Comment: Message-ID: <[EMAIL PROTECTED]> Date: Thu, 29 Jun 2006 19:14:11 +0100 From: "Dave Elcock" <[EMAIL PROTECTED]> To: [email protected] Subject: [Lib3ds-devel] Mirroring mystery solved! This is a fix for bug 1077795, which has been bugging me for about 2 years. It took me ages to figure this out, but the solution is quite small in the end. There's nothing wrong with what lib3ds itself is doing, it's just the player's interpretation of the matrices that's slightly lacking. If the determinant of the node matrix is less than 0, it means that it describes a right-hand coordinate system, so it needs mirrored in the YZ plane, and the pivot.x should be negated too. Patch follows below. Cheers, Dave. p.s. In trying to solve this, I added some new functionality to do the "Polar Matrix Decomposition" stuff from Graphics Gems IV. This includes 3ds Max-like decomp_affine etc, which could be fairly useful. If you want it, let me know and I'll send in the patches. p.p.s. Oh, and my problems with getting the build going was due to me using ancient autoconf and automake. I was on autoconf 2.13 and automake 1.4-p6. Still toiling away on Mandrake 9.1! Index: examples/player.c =================================================================== RCS file: /cvsroot/lib3ds/lib3ds/examples/player.c,v retrieving revision 1.7 diff -u -r1.7 player.c --- examples/player.c 10 May 2005 12:02:08 -0000 1.7 +++ examples/player.c 29 Jun 2006 17:45:26 -0000 @@ -672,7 +672,13 @@ glPushMatrix(); d=&node->data.object; glMultMatrixf(&node->matrix[0][0]); - glTranslatef(-d->pivot[0], -d->pivot[1], -d->pivot[2]); + if (lib3ds_matrix_det(node->matrix) < 0.0) { + glScalef(-1.0, 1.0, 1.0); + glTranslatef(d->pivot[0], -d->pivot[1], -d->pivot[2]); + } + else { + glTranslatef(-d->pivot[0], -d->pivot[1], -d->pivot[2]); + } glCallList(mesh->user.d); /* glutSolidSphere(50.0, 20,20); */ glPopMatrix(); Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ lib3ds-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lib3ds-devel ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=304041&aid=1539617&group_id=4041 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ lib3ds-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lib3ds-devel
