Mesh edits in Notepad -Orientations

Looking for help with Orienting Hardpoints.

MANUALLY EDITING MESHES IN TXT FORMAT

These are Left and Right oriented weapons, respectively, from the Illuminator
    Point
        DataString "Weapon-0"
        Position [ -27.531000 0.000000 -0.797713 ]  -X LEFT, -Z Rear; Faces Left
        Orientation
             [ -0.000000 0.000000 1.000000 ]
             [ 0.000000 1.000000 0.000000 ]
             [ -1.000000 0.000000 -0.000000 ]
    Point
        DataString "Weapon-0"
        Position [ 27.531000 0.000000 -0.797717 ]  +X RIGHT, -Z Rear; Faces Right
        Orientation
             [ -0.000000 0.000000 -1.000000 ]
             [ 0.000000 1.000000 0.000000 ]
             [ 1.000000 0.000000 -0.000000 ]

Front Oriented weapon from Illuminator
    Point
        DataString "Weapon-0"
        Position [ 0.000007 0.000000 79.560600 ] +Z forward set
        Orientation
             [ 1.000000 0.000000 0.000000 ]
             [ 0.000000 1.000000 0.000000 ]
             [ 0.000000 0.000000 1.000000 ]

Rear Oriented weapon
    Point
        DataString "Weapon-1"
        Position [ -21.103998 19.282158 -55.494915 ] -X LEFT; -Z Rear
        Orientation
             [ -1.000000 -0.000000 -0.000000 ]
             [ -0.000000 1.000000 -0.000000 ]
             [ 0.000000 -0.000001 -1.000000 ]
    Point
        DataString "Weapon-1"
        Position [ 21.104492 19.282158 -55.494915 ] +X RIGHT; -Z Rear
        Orientation
             [ -1.000000 -0.000000 -0.000000 ]
             [ -0.000000 1.000000 -0.000000 ]
             [ 0.000000 -0.000001 -1.000000 ]

Exhaust Example
    Point
        DataString "Exhaust"
        Position [ 0.000000 -0.389800 -294.155914 ]
        Orientation
             [ -1.000000 0.000000 0.000000 ]
             [ 0.000000 1.000000 0.000000 ]
             [ 0.000000 0.000000 -1.000000 ]

CapitalShip Tech Mesh Hangar Points : angled forward
     Point
        DataString "Hangar"
        Position [ -15.876904 38.784996 305.145691 ]
        Orientation
             [ 1.000000 0.000000 0.000000 ]
             [ 0.000000 1.000000 -0.500000 ]
             [ 0.000000 0.500000 1.000000 ]
     Point
        DataString "Hangar"
        Position [ 42.409424 -57.426571 228.552994 ]
        Orientation
             [ 1.000000 0.000000 -0.258819 ]
             [ 0.129410 1.000000 0.500000 ]
             [ 0.224144 -0.500000 1.000000 ]

Having looked over the TEC Capital Carrier, top hangars and bottom hangars, I need to preface this with GRIDDING those 9 numbers.

[A][B][C]
[D][E][F]
[G][H][I]

What do each of these sets of numbers relate to, how does each affect orientation?  I've observed the above and drawn some conclusions.  The arrangement of the values can't be without pattern or reason.

A and I, if A and I are +, then Forward Oriented. 
A and I, if A and I are -, then Rear Orientated.

G E C, if G is -, C is +, then Left Orienated. 
G E C, If G is +, C is -, then Right Oriented. 
+G decimal value means hangar orientation is angled just slightly to the right, if negative it would be rotated slightly left.  Not sure why C must be opposite of G.

As relates to the Hangars... I see they face forward, that the top ones are angled 45 degrees.  Values in F and H seem to deal with that.

E so far is always positive
Positions B, D are a total mystery.

I think I understand the basics.  I can put weapon hardpoints pretty easy if only Front, Rear, Left, Right oriented.  If the weapon hardpoint or hangar requires any rotation around X, Y, Z axis', I think I can get away with a little.

However, if I wanted to make a new missile hardpoint, have it oriented 45 degrees off straight forward and also angled 45 degrees up, I'd be really lost.  I'd also be equally hosed if I had to make a (choose facing) missile hardpoint that fired straight up or down

Can anyone explain the Orientation Positions in detail so those of us who want to manually hardpoint weapons, flairs, abilities positions and not have them be the basic Front, Rear, Left, Right facings?

I'll be doing a lot of testing and experimenting, but any help welcome.

2,132 views 2 replies
Reply #1 Top

Well, it is simple and complex in the same time... like anything in 3D, it is based on complex topology mathematic... in this case, orientation matrix is related to Euler angles...

Some educative link :

- Euler angles : http://en.wikipedia.org/wiki/Euler_angles

- Rotation matrix : http://en.wikipedia.org/wiki/Rotation_matrix read first the two dimensional matrix and look at the "common rotations"... once you understand the 2D rotation matrix, you will easily understand the 3D one...

However, if I wanted to make a new missile hardpoint, have it oriented 45 degrees off straight forward and also angled 45 degrees up, I'd be really lost. I'd also be equally hosed if I had to make a (choose facing) missile hardpoint that fired straight up or down
End of quote

well, some pratice now... first, you wish a "45 degrees off straight foward"... hmmm, i cannot give you a single solution these case since you don't say if it is 45° clockwise or counterclokwise...

any way, it is a y axis rotation... let call is Rya ( rotation from y with a angle a )

Tya=( cos a , 0 , sin a ) ( 0 , 1 , 0 ) ( -sin a , 0 , cos a )

The 0 and 1 will never change in the case of a y axis rotation ( y axis rotation mean that the horizontal plane is rotating )... a 45° rotation will give the following result ( first case is +45°, second one is -45° ) rounded at 6 decimal like in sins

Ty45 = ( 0.707107 , 0 , 0.707107 ) ( 0 , 1 , 0 ) ( -0.707107 , 0 , 0.707107 ) 

Ty-45 = ( 0.707107 , 0 , -0.707107 ) ( 0 , 1 , 0 ) ( 0.707107 , 0 , 0.707107 )

Now, for the rotation 45 degree up... if i good remember, in sins, the axis Z is for the front... so, a x rotation will make the job for up and down... let call it Txb ( rotation from x with a angle b )

Txb = ( 1 , 0 , 0 ) ( 0 , cos b , -sin b ) ( 0 , sins b , cos b )

Tx45 = ( 1 , 0 , 0 ) ( 0 , 0.707107 , -0.707107 ) ( 0 , 0.707107 , 0.707107 )

For a rotation along the Z axis, formula will be :

Tzc = ( cos c , -sin c , 0 ) ( sin c, cos c , 0 ) ( 0 , 0 , 1 )

in these case c is 0, so

Tz0 = ( 1 , 0 , 0 ) ( 0, 1 , 0 ) ( 0 , 0 , 1 )

So, it is enough easy to calculate matrix for one single axis rotation... combine them is a other problem... The final matrix is a sequence of 3 rotations... Since matrix multiplication don't commute, the order of the rotation will affect the result... because of this, i will use a order who is the norm in 3D topology... for sins case, to be sure, ask dev about the rotation order, it is very possible that y and x order rotation are inverted and i have not time for make practical test on existing model ... rotate first x, followed by y and z in the end... let call these final matrix Txaybzc where a is the rotation angle of x, b is the rotation angle of y and c is the rotation angle of z...

Txaybzc = Tzc * Tya * txb =

( cos a * cos c , sin b * sin a * cos c - cos b * sin c , cos b * sin a * cos c + sin b * sin c )

( cos a * sin c , sin b * sin a * sin c + cos b * cos c , cos b * sin a * sin c - sin b * cos c )

( -sin a , sin b * cos a , cos b * cos a )

If you look at http://en.wikipedia.org/wiki/Euler_angles#Matrix_orientation , my result matrix is from the type ZYX... once you know the matrix orientation used by sins ( 12 possibilities ), you can make the right final matrix... This post give you the needed knowledge for calculate the matrix once you know what matrix orientation sins is using.

Formula for calcul angle rotation from the matrix data is enough simple if you have a calculator with arcsin, arccos, arctan ( windows calculator in scientific mode don't have it )... if you have some basic programming skill, you can perfectly make a tool for calculate matrix from angle and angle from matrix...

For example, in the case of a ZYX matrix, value being

Txaybzc = ( v11 , v12 , v13 ) ( v21 , v22 , v23 ) ( v31 , v32 , v33 )

Pseudo code for find the rotation angle a (x axis ), b ( y axis ), c ( z axis ) will be something like :

IF ABS ( v31 ) <> 1
  b1 = -asin ( v31 )
  b2 = pi - b1
  a1 = atan2 ( v32 / cos b1 , v33 / cos b1 )
  a2 = atan2 ( v32 / cos b2 , v33 / cos b2 )
  c1 = atan2 ( v21 / cos b1 , v11 / cos b1 )
  c2 = atan2 ( v21 / cos b2 , v11 / cos b2 )
else
  c = 0
  if ( v31 = -1 )
    b = pi / 2
    a = c + atan2 ( v12 , v13 )
  else
    b = - pi / 2
    a = - c + atan2 ( -v12 , -v13 )
  endif
endif

Well, it is a enough long post, with a lot of theory and who don't really solve your problem since we don't know ( yet )the matrix orientation used by sins... but once know, you will be able to calculate matrix for any rotation angle of the 3 axis... or calculate the reverse, find the 3 angles from the matrix... some coding knowledge will allow you to create a tiny software for make the job for you... My pseudo code example is not perfect because i choice to ignore the singularity at the north/south pole... if you have really some interest, i advice you to visit http://www.euclideanspace.com/maths/algebra/matrix/orthogonal/rotation/index.htm and explore the full site...

 

Reply #2 Top

Well, that made my brain explode.  I've been tinkering with notepad to work orientations around.

Some progress...

http://youtu.be/BMDe4XZ37EY