Scaling the matrix


RE: Scaling the matrix
#12
(2019-11-08, 15:35)N. W. Perry Wrote: Yeah, I guess what I was asking was more like what each separate box can be said to represent. The boxes themselves aren't complete coordinates, but factors—amounts of change, I guess? And you're right, when you combine transformations (such as rotating around multiple axes), you'll end up populating more boxes than with a single operation (and combining the values of some boxes together).

But is there a simply way to say, for example, the top-left box represents the ratio of an original x value to its new x position, and so forth?

The short answer is that it's complicated. Standard 3D transformations (rotating, scaling, and translating) each have a specific set of values that they operate on in a standard 4x4 3D transformation matrix. (For references, the 3x3 matrix you see is the upper left corner of a 4x4 general transformation matrix.)

Things are complicated by the fact that there are actually two different ways that people apply the transformations, and the ways are mirrored across the matrix's top-left to bottom-right diagonal. So, in one way, the top three elements of the 4th column represent the x,y,z translation, and in the mirrored way, the left three elements of the 4th row represent the same thing. Both ways produce the same end results, as long as they are used consistently.

Here is a tutorial that lists how the typical transformations are applied to the standard matrix. It uses the representation that has the x,y,z translation as the left three elements of the 4th column. I think that most LDraw software uses the top three elements of the 4th row for the x,y,z translation, in which case you would need to mirror all the sample matrices along the top-left to bottom-right diagonal. I could be misremembering; it has been a long time since I paid any attention to LDView's matrix math. Also, LDCad presents the x,y,z translation as a separate set of fields, and doesn't provide access to the remaining 4 fields in the 4x4 matrix. If you look at the tutorial, you will see that these 4 values are always 0,0,0,1, so that doesn't really matter.

But if you look specifically at the scale transformation, you will see exactly what Philo said originally: the three fields along the diagonal represent the x, y, and z scale factors. (Remember that in LDraw, "up" is -Y.)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Scaling the matrix - by N. W. Perry - 2019-11-04, 17:30
RE: Scaling the matrix - by Johann Eisner - 2019-11-04, 20:32
RE: Scaling the matrix - by Travis Cobbs - 2019-11-04, 22:05
RE: Scaling the matrix - by Johann Eisner - 2019-11-04, 22:19
RE: Scaling the matrix - by N. W. Perry - 2019-11-05, 11:47
RE: Scaling the matrix - by Philippe Hurbain - 2019-11-05, 17:35
RE: Scaling the matrix - by Roland Melkert - 2019-11-05, 19:41
RE: Scaling the matrix - by Philippe Hurbain - 2019-11-05, 20:10
RE: Scaling the matrix - by N. W. Perry - 2019-11-06, 6:00
RE: Scaling the matrix - by Owen Dive - 2019-11-06, 9:33
RE: Scaling the matrix - by N. W. Perry - 2019-11-08, 15:35
RE: Scaling the matrix - by Travis Cobbs - 2019-11-08, 21:11
RE: Scaling the matrix - by Roland Melkert - 2019-11-08, 21:34
RE: Scaling the matrix - by N. W. Perry - 2019-11-09, 5:11
RE: Scaling the matrix - by N. W. Perry - 2020-03-28, 2:04
RE: Scaling the matrix - by Roland Melkert - 2020-03-28, 2:38
RE: Scaling the matrix - by N. W. Perry - 2020-03-28, 5:08
RE: Scaling the matrix - by Roland Melkert - 2020-03-28, 19:21
RE: Scaling the matrix - by N. W. Perry - 2020-03-28, 20:53
RE: Scaling the matrix - by Roland Melkert - 2020-03-28, 21:59
RE: Scaling the matrix - by N. W. Perry - 2020-03-29, 1:28

Forum Jump:


Users browsing this thread: 2 Guest(s)