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

"Getting started", "Manuals", "Tutorials", "Tools", "Tips and tricks", "Sources", etc.

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

Unread postby PapaXpress » Thu Aug 16, 2012 11:09 pm

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.
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone

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

Unread postby up_8677 » Mon Aug 20, 2012 12:37 am

So that fun class called linear algebra is actually useful for something! !**duh*!!



Very interesting. !!*ok*!!
up_8677
 
Posts: 341
Joined: Tue May 15, 2012 9:31 pm

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

Unread postby Chacal » Sun Mar 31, 2013 4:17 pm

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
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6464
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

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

Unread postby blasdani » Fri Nov 14, 2014 2:35 pm

Thanks!
I don't know this.
blasdani
 


Return to Information for new authors, builders and editors" (RWA developer's manual)

Who is online

Users browsing this forum: No registered users and 1 guest