Re: [Algorithms] Scaling Models
Brought to you by:
vexxed72
From: <ro...@do...> - 2000-07-29 05:14:49
|
Tom Hubina wrote: >I don't generally use scales on matrices this way (and the description is >atrocious from a math standpoint) so Ron can correct me here as needed, but >I seem to recall there being two ways to add a scale to a matrix. For a >non-uniform scale you can monkey with the different components to get what >ya need, or for a uniform scale you can insert the scale value directly >into the lower right corner of the matrix. Yes, for the uniform scale this is a trick that works in the context of the 4x4 matrix, but it doesn't fall out until you do the projection. That is, you end up with points that have w != 1 before projecting. This is an ugly artifact of the 4x4 homogeneous formulation, which I detest. Part of its ugliness is that it doesn't generalize to the non uniform scale. >If you're doing a uniform scale, >and using homogenous matrices as I've described above you wouldn't need to >re-normalize the normal since the uniform scale would be ignored for >vectors (since the 4th component is zero). Vectors will still be affected >by the more traditional scales, and even if they're uniform, will need to >be normalized before they can be used in most lighting and environment >mapping situations. > And of course, in the case that the transformation contains within it a non-uniform scale, you are completely wrong unless you transpose(inverse(the upper 3x3)), before applying it to the normal vectors. See my response to the original post of this thread. |