<br><br><div class="gmail_quote">On Mon, Jul 30, 2012 at 4:31 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, 24 Jul 2012 11:31:59 -0600<br>
Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>> wrote:<br>
<br>
> When computing a matrix inverse, if the determinant is too small we could hit<br>
> a divide by zero.  There's a check to prevent this (we basically give up on<br>
> computing the inverse and return the identity matrix.)  This patches loosens<br>
> this test to fix a lighting bug reported by Lars Henning Wendt.<br>
><br>
> NOTE: This is a candidate for the 8.0 branch.<br>
> ---<br>
>  src/mesa/math/m_matrix.c |    2 +-<br>
>  1 files changed, 1 insertions(+), 1 deletions(-)<br>
><br>
> diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c<br>
> index 02aedba..ef377ee 100644<br>
> --- a/src/mesa/math/m_matrix.c<br>
> +++ b/src/mesa/math/m_matrix.c<br>
> @@ -513,7 +513,7 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat )<br>
><br>
>     det = pos + neg;<br>
><br>
> -   if (det*det < 1e-25)<br>
> +   if (det < 1e-25)<br>
>        return GL_FALSE;<br>
><br>
>     det = 1.0F / det;<br>
<br>
</div>Hi,<br>
<br>
just a fly-by question; doesn't that break if determinant is negative?<br>
I.e. reflection transformations.<br>
<br></blockquote><div>Yeah, I think you need a fabsf() there.</div><div> </div></div>