Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336898

Summary: Matrix inversion code does not always work
Product: z_Archived Reporter: Kristian Duske <kristian.duske>
Component: Gef3dAssignee: Project Inbox <gef3d.draw3d-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: developer
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Kristian Duske CLA 2011-02-11 02:35:07 EST
First, the matrix inversion algorithm in Math3DMatrix4f#invert() does not check whether the matrix is invertible (determinant != 0) beforehand. It also uses a shorthand method that only works in special cases (see wikipedia). For cases in which the special method fails, the general algorithm has to be used (divide matrix of cofactors by own determinant).
Comment 1 Jens Von Pilgrim CLA 2011-02-11 04:00:04 EST
Fixed: Firstly the determinant is calculated. Then, block wise inversion is used, testing whether the block matrices are correctly invertible. If they are not, a general but slower algorithm is used. This may be optimized, e.g., for general algorithm could be replaced by the Gauß-Jordan algorithm.