Page 1 of 1

The Matrix: Rotations

Unread postPosted: Thu Aug 16, 2012 7:22 pm
by SMMDigital
Does anyone have any idea what lines in the positional matrix of an assets .bin file govern rotation? I know that the last four lines govern x-y-z movement but im having no luck with the other. I have a light that i'm trying to point in the opposite direction by hacking the .bin file with RW_Tools.

Re: The Matrix: Rotations

Unread postPosted: Thu Aug 16, 2012 7:43 pm
by Bananarama
I don't recall offhand which line it was. What I do is to export through the asset editor and rotate in the desired direction and angle (need not be perfect), and then adjust the values in the blueprint by hand.

Re: The Matrix: Rotations

Unread postPosted: Thu Aug 16, 2012 8:06 pm
by Kali
This ought to go in a FAQ somewhere, I think.

http://forums.uktrainsim.com/viewtopic. ... 0#p1549720 - just read "top to bottom" instead of "left to right".

Quite easy to knock up a generic spreadsheet for doing single rotation, but if you want to do two angles together they need doing individually.

Re: The Matrix: Rotations

Unread postPosted: Thu Aug 16, 2012 9:40 pm
by Machinist
SMMDigital wrote:Does anyone have any idea what lines in the positional matrix of an assets .bin file govern rotation? I know that the last four lines govern x-y-z movement but im having no luck with the other. I have a light that i'm trying to point in the opposite direction by hacking the .bin file with RW_Tools.

I thought with a 3D Design tool was easy to rotate any object, it's a pain to do that by typeing matrix (as I use to do once I don't have basic model source). IIRC each five positions you have a direction, but the problem is the following 4 positions because if the values are wrong it results in a distorced object therefore it doesn't work. Once I got it indirectly placing a spotlight in a cenario and then checking its coordinates in the scenario bin, but took me hours, I opted to not repeat the experience again, isn't worth the effort... Maybe someday I'll give a try again (maybe is each four positions as Kali mentioned).

Re: The Matrix: Rotations

Unread postPosted: Thu Aug 16, 2012 10:58 pm
by Kali
I wrote the post I linked, I know exactly what it is :p matrices like those are very common in 3d graphics, it's very easy to apply transformation matrices to them - basically you just use the top left corner of the overall matrix, and multiply it with a 3x3 transformation matrix - matrix work is practically all I can remember from my graphics programming modules. I couldn't really get it any more concise than that post anyway.

If someone wants to copy it all & stick it in a faq here, go ahead.

Re: The Matrix: Rotations

Unread postPosted: Thu Aug 16, 2012 11:12 pm
by PapaXpress

Re: The Matrix: Rotations

Unread postPosted: Fri Aug 17, 2012 12:39 am
by Kali
!!*ok*!!

Re: The Matrix: Rotations

Unread postPosted: Fri Aug 17, 2012 8:29 am
by Machinist
!!*ok*!! Kali & Papa

@ Kali, by chance do you have (or could create) a spreadsheet for automatic calcs? I never did it in Excel. *!sad!*

Thanks,
Doc.

Re: The Matrix: Rotations

Unread postPosted: Sun Aug 19, 2012 12:46 am
by Kali
I did somewhere, but only for single rotations ( and scaling ) - there's far too many combinations to do all of them in one sheet, it's totally unwieldy. I'm sure I gave it out to someone recently, but I don't know what I've done with it.

You can more or less literally put the formula from Wiki into a spreadsheet though.