Search code examples
matrixnormalizationmatrix-multiplication

How to normalize a world matrix?


Here's my situation: I have a world matrix. I'm scaling to be half-size, so multiplying (0,0),(1,1), and (2,2) by .5f

When I do this, the normals in the mesh I'm trying to display become half-sized too, which kills a glare effect I'm trying to do.

Is there a way to get the scale of that matrix back to 1.0 without having to remember the scale value so it can be multiplied back it? Is it possible to normalize a matrix so that it retains its rotation, but is scaled to 1.0 and is translated to 0,0,0?


Solution

  • So after much tweaking and testing, I did find that, for my purposes, simply treating each column as a vector and normalizing them yielded the results I wanted: A matrix that scaled to 1:1 while retaining the rotational information.

    Leaving this up because I wasn't able to find this quick answer with a web search.