Page 1 of 1

Changing object X,Y,Z position by editing BIN or GeoPcDx File

Unread postPosted: Thu Aug 16, 2012 11:09 pm
by PapaXpress
From left to right in that row of numbers, this is the position of each digit in the 4x4 matrix - the top left corner is a 3x3 rotation matrix, the last column, 13-14-15 is for translation ( ie positioning ). Scaling is along the top-left to bottom-right diagonal.

1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16

-

Scaling:

Image

Fairly obvious, position 1 is scaling by X, 6 is scaling by Y, 11 is scaling by Z, and 16 really should scale all of them - but the last couple of times I've tried have produced some rather odd results.

Rotation:

http://en.wikipedia.org/wiki/Rotation_matrix

As mentioned before, this is the top left corner of the 4x4 matrix above.

Image

Top to bottom, rotation around X, around Y, around Z. You need to multiply the existing matrix with that, not just replace it, or you will lose any scaling.

If you want to rotate in two or three dimensions you need to make a matrix for each rotation, and then multiply them together. I think rotations are always around the local origin of the object which simplifies things enormously ( you don't need to worry about rotating and then translating vs translating and rotating, it's not the same thing! ).

This is all exactly the same as the matrix for a child object. There are other transformations you can do but they're not really useful in this situation.

Transferred and stickied as per Kali's request.

Re: Changing object X,Y,Z position by editing BIN or GeoPcDx File

Unread postPosted: Mon Aug 20, 2012 12:37 am
by up_8677
So that fun class called linear algebra is actually useful for something! !**duh*!!



Very interesting. !!*ok*!!

Re: Changing object X,Y,Z position by editing BIN or GeoPcDx File

Unread postPosted: Sun Mar 31, 2013 4:17 pm
by Chacal
I have posted a cleaned-up and augmented version of this on the web site's learning center.
It is available here:
http://railworksamerica.com/index.php/l ... t-position

Re: Changing object X,Y,Z position by editing BIN or GeoPcDx File

Unread postPosted: Fri Nov 14, 2014 2:35 pm
by blasdani
Thanks!
I don't know this.