Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Bobboau on October 02, 2004, 08:58:04 pm

Title: moment of inertia
Post by: Bobboau on October 02, 2004, 08:58:04 pm
we all know that this has been a bit of a thorn in our sides, this little 3x3 matrix in all the V models that we haven't been able to figure out how to calculate, and thus our models when converted don't act corectly.
well over the last day or so, I've been doing quite a bit or research, it turns out that this isn't simply a matrix, but it is in fact a tensor (http://mathworld.wolfram.com/Tensor.html).
further, I have managed to figure out a partal formula for figureing it out, I am posting my findings now in hopes that someone else can figure it out, and so I don't foget.

Code: [Select]

[
[ƒ°(y^2+z^2)],  [-ƒ°(x*y)],     [-ƒ°(x*z)],
[-ƒ°(x*y)],     [ƒ°(x^2+z^2)],  [-ƒ°(y*z)],
[-ƒ°(x*z)],     [-ƒ°(y*z)],     [ƒ°(x^2+y^2)]
]


that'd be the sum of every particle * mass/n_paricles as n_particles->infinity, x,y and z are the coords of °th particle

(ƒ° == sum, screwy font...)
Title: moment of inertia
Post by: redsniper on October 02, 2004, 10:09:38 pm
finally someone's starting to figure this out. good job as usual, bob. :yes:
Title: moment of inertia
Post by: Liberator on October 03, 2004, 12:04:18 am
Dear God, I started bleeding from my nose and ears just from reading that link...:shaking:
Title: moment of inertia
Post by: kasperl on October 03, 2004, 04:00:49 am
IF (math > 5th grade Dutch high school) THEN {
CRASH and BURN
}
Else{
be-bored
}


cough

nyway, this is a bit too advanced for me, but it looks like a good job.
Title: moment of inertia
Post by: magatsu1 on October 03, 2004, 07:24:39 am
I have no idea what this thread is about...:nervous:
Title: moment of inertia
Post by: Blitzerland on October 03, 2004, 09:09:02 am
Great job! Decode that spagetti logic! :p

Really wish :v: would have documented some of that code.
Title: moment of inertia
Post by: KARMA on October 04, 2004, 07:52:00 am
I think that just making this post in public you prevented lots of people to try learn programming eheh :)
Title: moment of inertia
Post by: Lightspeed on October 04, 2004, 11:02:53 am
I just copy it from similar V models and it worked like a charm so far. :p

If you use models from FS1, you'll have to apply specific multipliers to the values for things to work properly. I figured those out once, some years ago.
Title: moment of inertia
Post by: magatsu1 on October 04, 2004, 11:12:32 am
I thinl he posted a load of complicated looking giberish just to try and look cool. :p :D
Title: moment of inertia
Post by: aldo_14 on October 04, 2004, 11:22:55 am
Quote
Originally posted by Lightspeed
I just copy it from similar V models and it worked like a charm so far. :p


Doesn't work for me.  CoW suffered big time from this.
Title: moment of inertia
Post by: Deepblue on October 04, 2004, 12:58:16 pm
Hmmmm. Since I do not understand the contents of this thread may I hope that you will implement semi-newtonian physics into the SCP?
Title: moment of inertia
Post by: Lightspeed on October 04, 2004, 02:07:30 pm
no. This is about the POF settings FS2 always had, and most mods ignore (fools! harrrrrrr.) :)
Title: moment of inertia
Post by: Taristin on October 04, 2004, 02:18:38 pm
Another reason TVWP will be superior. :p
Title: moment of inertia
Post by: Nuke on October 04, 2004, 03:41:42 pm
i wish people would start explaining how theese settings work in a manner that those of us who suck at math can understand.
Title: moment of inertia
Post by: aldo_14 on October 04, 2004, 03:47:39 pm
http://en.wikipedia.org/wiki/Tensor

In mathematics, a tensor is a certain kind of geometrical entity which generalizes the concepts of scalar, vector (spatial) and linear operator in a way that is independent of any chosen frame of reference. Tensors are of importance in physics and engineering.

While tensors can be represented by multi-dimensional arrays of components, the point of having a tensor theory is to explain the further implications of saying that a quantity is a tensor, beyond that specifying it requires a number of indexed components. In particular, tensors behave in special ways under coordinate transformations.
Title: moment of inertia
Post by: KARMA on October 04, 2004, 04:55:06 pm
the funny thing is that I thought bob was discussing about some piece of ununderstanded code related to the game physic :D
well, maybe not so funny:nervous:
Title: moment of inertia
Post by: Flaser on October 04, 2004, 05:35:25 pm
AFAIK know a tensor is a special matrix, which can be used as an operator.

The said matrix multiplied by a vector may give you another vector.

Oversimplifid one dimensional example is mass as the tensor and aceleration as the vector and as a result you may get the velocity.

What Bob diged up seems early similar to the tensor we use in Strudiness (a matter I study at uni).

It is a 3x3 matrix, where the main diagonal has the secondary inertia of the particle for both axeses, while the other components have the simple secondary inertia.
Title: moment of inertia
Post by: Nuke on October 04, 2004, 09:26:14 pm
so how does this relate to the ships physics characteristics in the game?
Title: moment of inertia
Post by: Omniscaper on October 04, 2004, 09:48:06 pm
AH.... It all makes sense now.

::downs tequila shot::

Its clear as crystal. What? huh!?
Title: moment of inertia
Post by: Bobboau on October 04, 2004, 10:20:56 pm
this means that if you have a 20 mile long ubber destroyer and it gets hit by a 5kg missle going 10 m/s the ship won't spin around. moment of inertia is basicly how hard it is to turn something.
Title: moment of inertia
Post by: Omniscaper on October 04, 2004, 10:37:02 pm
Ah. Well I've successfully managed to cut and paste FS2's MOI settings from similiar sized vessels. I know its a long shot but any chance  MOI can be manipulated to allow newtonian physics? I think it would be cool to do turn around while flying forward like the old Wing Commander III game.
Title: moment of inertia
Post by: Bobboau on October 04, 2004, 11:28:49 pm
no, totaly unrelated
Title: moment of inertia
Post by: Flipside on October 04, 2004, 11:42:11 pm
Hmmmmmmm...... I think I get the jist of it, though the maths is beyond me. It 'may' be useful if I can get my head round it.......
Title: moment of inertia
Post by: Mongoose on October 04, 2004, 11:59:07 pm
So theoretically, you might be able to fool around and get, say a Moloch to be thrown halfway across the galaxy by a Harpoon?  Cool! :D
Title: moment of inertia
Post by: IceFire on October 05, 2004, 07:20:56 pm
The biggest example of this is the AAA beams.  Normal FS2 ships get hit and get knocked around a good deal.  Our MOD ships get hit and fly through them like they have a billion tons of mass.

This is why MOD ships including fighters, cruisers, and destroyers behave differently than normal FS2 ships when hit by weapons.  Generally the effect is unpleasant although not always noticeable.
Title: moment of inertia
Post by: Bobboau on October 05, 2004, 07:39:38 pm
the diagnal three are the most important, the bigger the number the more your ship will get knocked about, PCS defaults these values to 0. mass is also an important figure, oftine underweight
Title: moment of inertia
Post by: ##UnknownPlayer## on October 05, 2004, 10:35:46 pm
Some suggestions as to how this could be solved (which I can't check now since I'm at uni)

 - Where does this matrix get read in in the source code?
 - What variables are linked to this data?

I'm pretty sure that if we tracked the use of the matrix through model loading (and if entirely necessary, through physics) we'd either figure out how it does what it does or at least be able to blindly reverse engineer the solution.

I'm willing to do this, but I need some more information on this since I've been out of the loop for a while (and specifically, didn't actually know this was a problem).
Title: moment of inertia
Post by: Bobboau on October 05, 2004, 11:34:50 pm
look in the model file reading code, it's twards the top, it loads it into a simple 3x3 matrix, the only other reference to the variable is a single matrix multiply (acting on an impulse vector IIRC) there isn't much footprint of this in the code but it has a signifigant effect