Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Bobboau on April 21, 2005, 06:00:44 pm
-
copy and past from mathematica, this is the formula for calculateing one of the six parts of moment of inertia for a polygon pefined by p1, p2 and p3
just thought I'd pass this along
:lol:
(\((\((p1x - p2x)\)\ \((\(-p2y\)\ p3x + p1y\ \((\(-p2x\) + p3x)\) +
p1x\ \((p2y - p3y)\) +
p2x\ p3y)\)\ \((p1x\^6\ \((\(-131\)\ p1z\^3\ p2y\^3 +
10\ p1y\^3\ p2z\ \((p2y\^2 + 8\ p2z\^2)\) -
51\ p1z\^2\ p2y\^2\ p2z\ \((p2y + p3y)\) -
11\ p1z\ p2y\ \((p2y\^2 + p2z\^2)\)\ \((p2y\^2 + p2y\ p3y +
p3y\^2)\) -
p2z\ \((3\ p2y\^2 + p2z\^2)\)\ \((p2y\^3 + p2y\^2\ p3y +
p2y\ p3y\^2 + p3y\^3)\) -
p1y\^2\ \((p1z\ \((13\ p2y\^3 + 280\ p2y\ p2z\^2)\) +
p2z\ \((\(-9\)\ p2y\^2 + 40\ p2z\^2)\)\ \((p2y +
p3y)\))\) +
2\ p1y\ \((165\ p1z\^2\ p2y\^2\ p2z -
3\ p1z\ p2y\ \((2\ p2y\^2 - 15\ p2z\^2)\)\ \((p2y +
p3y)\) +
p2z\ \((4\ p2y\^2 + 5\ p2z\^2)\)\ \((p2y\^2 +
p2y\ p3y + p3y\^2)\))\))\) +
p2x\^3\ \((p1y\^5\ \((p2z\ p3x\ \((\(-4\)\ p2x\^2 +
11\ p2x\ p3x - 9\ p3x\^2)\) +
3\ p1z\ \((p2x\^3 - 4\ p2x\^2\ p3x + 6\ p2x\ p3x\^2 -
4\ p3x\^3)\))\) +
p1y\ p1z\^2\ \((3\ p1z\ p2x - 4\ p1z\ p3x -
4\ p2z\ p3x)\)\ \((p2y\ p3x - p2x\ p3y)\)\^2 +
p1z\^3\ \((p2y\ p3x - p2x\ p3y)\)\^3 +
p1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\ p3y\^2)\) +
p2x\^2\ p2y\ p3x\ \((3\ p2y\^2 - 20\ p2y\ p3y +
39\ p3y\^2)\))\) +
p1z\^3\ \((131\ p2y\^3\ p3x\^3 -
51\ p2x\ p2y\^2\ p3x\^2\ \((3\ p2y - p3y)\) +
p2x\^2\ p2y\ p3x\ \((33\ p2y\^2 + 58\ p2y\ p3y +
11\ p3y\^2)\) +
p2x\^3\ \((\(-p2y\^3\) - 19\ p2y\^2\ p3y +
19\ p2y\ p3y\^2 + p3y\^3)\))\) +
p1y\^4\ p2x\ \((p1z\ p2x\ \((\(-17\)\ p2x\ p2y +
75\ p2y\ p3x + 3\ p2x\ p3y)\) +
p2z\ \((\(-112\)\ p2y\ p3x\^2 +
17\ p2x\ p3x\ \((3\ p2y - 2\ p3y)\) +
p2x\^2\ \((\(-11\)\ p2y + 10\ p3y)\))\))\) +
p1y\^3\ \((p1z\^3\ p2x\^3 +
p1z\^2\ p2x\^2\ p2z\ \((11\ p2x - 39\ p3x)\) +
p2z\ \((\(-\((24\ p2y\^2 + 49\ p2z\^2)\)\)\ p3x\^3 +
p2x\ p3x\^2\ \((\(-48\)\ p2y\^2 + 161\ p2z\^2 -
32\ p2y\ p3y)\) +
p2x\^3\ \((p2z\^2 + 30\ p2y\ p3y -
21\ p3y\^2)\) +
p2x\^2\ p3x\ \((12\ p2y\^2 - 39\ p2z\^2 -
54\ p2y\ p3y + p3y\^2)\))\) +
p1z\ p2x\ \((\((166\ p2y\^2 +
161\ p2z\^2)\)\ p3x\^2 +
p2x\ p3x\ \((\(-51\)\ p2y\^2 - 109\ p2z\^2 +
70\ p2y\ p3y)\) +
p2x\^2\ \((14\ p2y\^2 + 11\ p2z\^2 -
16\ p2y\ p3y + 3\ p3y\^2)\))\))\) +
p1y\^2\ \((p1z\^3\ p2x\^2\ \((51\ p2y\ p3x +
p2x\ \((\(-13\)\ p2y + p3y)\))\) +
p1z\^2\ p2x\ p2z\ \((\(-434\)\ p2y\ p3x\^2 +
p2x\ p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)\))\) -
p1z\^3\ p2y\ \((393\ p2y\^2\ p3x\^2 -
51\ p2x\ p2y\ p3x\ \((3\ p2y - 2\ p3y)\) +
p2x\^2\ \((11\ p2y\^2 + 29\ p2y\ p3y +
11\ p3y\^2)\))\) -
p1z\^2\ p2z\ \((51\ p2y\^2\ p3x\^2\ \((3\ p2y + p3y)\) +
p2x\ p2y\ p3x\ \((\(-33\)\ p2y\^2 + 80\ p2y\ p3y +
22\ p3y\^2)\) +
p2x\^2\ \((p2y\^3 - 10\ p2y\^2\ p3y +
39\ p2y\ p3y\^2 + 3\ p3y\^3)\))\) +
p1y\^3\ \((10\ p1z\^2\ p2x\^2\ p2z +
p1z\ p2x\ \((\(-6\)\ \((19\ p2y\^2 +
25\ p2z\^2)\)\ p3x +
p2x\ \((13\ p2y\^2 + 50\ p2z\^2 -
18\ p2y\ p3y)\))\) +
p2z\ \((2\ \((28\ p2y\^2 + 85\ p2z\^2)\)\ p3x\^2 +
p2x\ p3x\ \((27\ p2y\^2 - 150\ p2z\^2 +
68\ p2y\ p3y)\) +
p2x\^2\ \((\(-3\)\ p2y\^2 + 10\ p2z\^2 -
12\ p2y\ p3y + 8\ p3y\^2)\))\))\) -
p1y\^2\ \((13\ p1z\^3\ p2x\^2\ p2y +
p1z\^2\ p2x\ p2z\ \((113\ p2x\ p2y - 378\ p2y\ p3x -
9\ p2x\ p3y)\) +
p1z\ \((p2y\ \((74\ p2y\^2 + 671\ p2z\^2)\)\ p3x\^2 +
p2x\ p3x\ \((51\ p2y\^3 - 488\ p2y\ p2z\^2 +
104\ p2y\^2\ p3y + 22\ p2z\^2\ p3y)\) +
p2x\^2\ \((33\ p2y\ p2z\^2 - 12\ p2y\^2\ p3y +
41\ p2z\^2\ p3y + 17\ p2y\ p3y\^2)\))\) +
p2z\ \((p3x\^2\ \((\(-40\)\ p2y\^3 +
101\ p2y\ p2z\^2 - 16\ p2y\^2\ p3y +
23\ p2z\^2\ p3y)\) +
p2x\ p3x\ \((\(-19\)\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))\))\))\) +
p1x\^5\ \((\(-20\)\ p1y\^4\ p2x\ p2y\ p2z +
3\ p1z\^3\ p2y\^2\ \((131\ p2y\ p3x -
17\ p2x\ \((p2y - p3y)\))\) +
p2z\ \((3\ p2y\^2 + p2z\^2)\)\ \((3\ p2y\^3\ p3x +
p2y\^2\ \((p2x + 2\ p3x)\)\ p3y +
p2y\ \((2\ p2x + p3x)\)\ p3y\^2 + 3\ p2x\ p3y\^3)\) +
p1y\^3\ \((p1z\ p2x\ \((29\ p2y\^2 + 40\ p2z\^2)\) +
p2z\ \((\(-7\)\ p2x\ p2y\^2 + 40\ p2x\ p2z\^2 -
39\ p2y\^2\ p3x - 200\ p2z\^2\ p3x -
18\ p2x\ p2y\ p3y)\))\) +
p1z\^2\ p2y\ p2z\ \((51\ p2y\ p3x\ \((3\ p2y + 2\ p3y)\) +
p2x\ \((\(-11\)\ p2y\^2 + 40\ p2y\ p3y +
22\ p3y\^2)\))\) -
p1z\ \((p2y\^2 +
p2z\^2)\)\ \((\(-11\)\ p2y\ p3x\ \((3\ p2y\^2 +
2\ p2y\ p3y + p3y\^2)\) +
p2x\ \((p2y\^3 - 10\ p2y\^2\ p3y - 21\ p2y\ p3y\^2 -
3\ p3y\^3)\))\) +
p1y\^2\ \((\(-100\)\ p1z\^2\ p2x\ p2y\ p2z +
p1z\ \((3\ p2y\ \((17\ p2y\^2 + 250\ p2z\^2)\)\ p3x +
p2x\ \((13\ p2y\^3 - 140\ p2y\ p2z\^2 +
27\ p2y\^2\ p3y + 30\ p2z\^2\ p3y)\))\) -
p2z\ \((p3x\ \((35\ p2y\^3 - 110\ p2y\ p2z\^2 +
34\ p2y\^2\ p3y - 60\ p2z\^2\ p3y)\) +
p2x\ \((5\ p2y\^3 + 20\ p2y\ p2z\^2 +
6\ p2y\^2\ p3y - 30\ p2z\^2\ p3y +
16\ p2y\ p3y\^2)\))\))\) +
p1y\ \((63\ p1z\^3\ p2x\ p2y\^2 +
3\ p1z\^2\ p2y\ p2z\ \((51\ p2x\ p2y -
313\ p2y\ p3x - 26\ p2x\ p3y)\) +
p1z\ \((p2y\ p3x\ \((47\ p2y\^3 - 259\ p2y\ p2z\^2 +
46\ p2y\^2\ p3y - 158\ p2z\^2\ p3y)\) +
p2x\ \((11\ p2y\^4 + 12\ p2y\^3\ p3y -
68\ p2y\ p2z\^2\ p3y -
19\ p2z\^2\ p3y\^2 +
p2y\^2\ \((33\ p2z\^2 +
25\ p3y\^2)\))\))\) +
p2z\ \((\(-p3x\)\ \((21\ p2y\^4 + 10\ p2y\^3\ p3y +
18\ p2y\ p2z\^2\ p3y +
7\ p2z\^2\ p3y\^2 +
p2y\^2\ \((29\ p2z\^2 - p3y\^2)\))\) +
p2x\ \((7\ p2y\^4 - 4\ p2y\^3\ p3y -
19\ p2z\^2\ p3y\^2 +
3\ p2y\^2\ \((p2z\^2 - 5\ p3y\^2)\) +
p2y\ \((\(-8\)\ p2z\^2\ p3y +
6\ p3y\^3)\))\))\))\))\))\))\)/\((60\ \
\((\(-p1y\)\ p2x + p1x\ p2y)\)\^3\ \((p1x - p3x)\)\^4)\)\)
-
So this would be like for a dropping cloth or something?
Watch, in a couple years someone will simplify this to a few simple operations "It's p1 = p2^p3, dumbass!"
-
My eyes and brains hurt now. As this is in the SCP forum, I presume you will implement that in the next build? :p
-
My brain popped.
-
that is BTW for one half of one polygon.
-
Bet you guys wish you hadn't upped the poly limit now :p
-
Just thinking that would it be possible to estimate MOIs for FS2 ships, mean like working backwards the definition of thresholds (limit, limes, or what the heck is it in english) used for example in integration. Like slicing models into x amount of cubes (1x1x1) and use these simple cubes to calculate reasonable estimates for MOIs. Accurate values would be very nice but perhaps estimates could be easier to do and still provide enough data to be reasonable with the models in game?
-
That's just..... ridiculous.
Surely theres a more simplistic way of getting ships to have inertia based on size?
-
Originally posted by Wanderer
Just thinking that would it be possible to estimate MOIs for FS2 ships, mean like working backwards the definition of thresholds (limit, limes, or what the heck is it in english) used for example in integration. Like slicing models into x amount of cubes (1x1x1) and use these simple cubes to calculate reasonable estimates for MOIs. Accurate values would be very nice but perhaps estimates could be easier to do and still provide enough data to be reasonable with the models in game?
Actually, since the MOI value is stored in an array of single-precision floating-point numbers, that's actually probably a fair guess. General ballpark estimates certainly work ok in-game. Maybe use the bounding boxes? You'd inherently want more precision on smaller objects than larger ones, so fixed-size boxes are out. But the bounding box function, as I recall, is a recursive division of the total model bounding box that only keeps around those which contain surfaces. That ought to be pretty close, but would simplify equations since each face's normal is in only one cartesian direction.
And remember, this is the job of converters, not the game, and most certainly not something that would have to be done in real-time. Any reasonable estimation that doesn't produce something 35 orders of magnitude off would be more useful than the current system.
-
Oh, it's all so simple. I understand MOI perfectly now! :rolleyes:
I'm glad that makes sense to someone.
-
That long formulae is a perfect example of overabstraction that's necessary when an automaton does the job and not a human who can "understand" it.
-
By the way, theres one too many open brackets..
Psyche!
-
I wouldn't be surprised.
It'd be a ***** to debug though. :p
-
I could estimate it, yes, but were would be the fun in that.
oh, and I've done some work and gotten that equasion down to a slightly more manageable:
\!\(1\/60\ \((\(-5\)\ x3\^3\ y1\ z1 - 5\ x3\ y1\^3\ z1 + 8\ x3\^3\ y2\ z1 +
x3\ y1\^2\ y2\ z1 + x3\ y1\ y2\^2\
z1 + 6\ x3\ y2\^3\ z1 - 3\ x3\^3\ y3\
z1 - 6\ x3\ y1\^2\ y3\ z1 + x3\ y1\ y2\ y3\
z1 + 6\ x3\ y2\^2\ y3\ z1 - 7\ x3\ y1\
y3\^2\ z1 + 6\ x3\ y2\ y3\^2\ z1 - 3\
x3\ y3\^3\ z1 - 7\ x3\^3\ y1\ z2 - 3\
x3\ y1\^3\ z2 + x3\^3\ y2\ z2 - 3\ x3\ y1\^2\
y2\ z2 - 3\ x3\ y1\ y2\^2\ z2 + 3\ x3\
y2\^3\ z2 + 6\ x3\^3\ y3\ z2 - 3\ x3\ y1\^2\ y3\
z2 - 3\ x3\ y1\ y2\ y3\ z2 + 4\ x3\ y2\^2\ y3\
z2 - 3\ x3\ y1\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 z3 + 3\ y2\^2\ y3\ z3 -
4\ y1\ y3\^2\ z3 + 3\ y2\
y3\^2\ z3 - 3\ y3\^3\ z3 + x3\ \((\(-3\)\
y1 + y2 + 2\ y3)\)\ z1\ z3 + x2\^2\ \((\(-5\)\ y2\ z1 + 7\ y3\ \
z1 + 3\ y2\ z2 - 7\ y3\ z2 + y1\ \((\(-2\)\
z1 + 4\ z2 - 7\ z3)\) + 7\ y2\ z3)\) +
x3\^2\ \((5\ y1\ z1 - 8\ y2\ z1 +
3\ y3\ z1 + 7\ y1\ z2 - 7\ y3\ z2 - 4\ y1\
z3 + 7\ y2\ z3 - 3\ y3\ z3)\) + x2\ \((\((\(-3\)\ y1 + 2\ y2 +
y3)\)\ z1\ z3 + x3\ \((3\ y1\
z1 - 9\ y2\ z1 + 6\ y3\ z1 + 7\ y1\ z2 - 7\ y3\
z2 - 7\ y1\ z3 + 7\ y2\ z3)\))\))\))\)\)
the other two central formulea are unfortunately about three times as long, but the product of inertia are practicly simple by comparason
for example:
\!\(1\/6\ xy\ \((x1\ y2\ z1 -
x1\ y3\ z1 - 2\ x1\ y1\ z2 - x1\ y2\ z2 + 3\ x1\ y3\
z2 + 2\ x1\ y1\ z3 - 3\ x1\ y2\ z3 + x1\ y3\ z3 + 2\ y1\ z1\
z3 - y2\ z1\ z3 - y3\ z1\ z3 +
x3\ \((\(-y3\)\ \((z1 - 2\ z2)\) + y2\ \((4\ z1 + z2 - z3)\) + y1\ \
\((\(-3\)\ z1 - 3\ z2 + z3)\))\) + x2\ \((2\ y2\ \((z1 -
z3)\) + y3\ \((\(-3\)\ z1 + z2 - z3)\) + y1\ \((z1 - z2 + 3\
z3)\))\))\)\)
-
Originally posted by Flipside
By the way, theres one too many open brackets..
You could actually check that pretty easily wih a find and replace in Word.. :nervous:
-
it's a lot clearer what this realy looks like if you remove all those forward slashes Mathematica uses (invisably) in it's syntax
-
well holy crap, defineing the normal arbitraraly actualy made it infinitely simpler
(((1/(60 norm.z))((((pt3.x (((-pt1.y) + pt2.y)) + pt2.x ((pt1.y - pt3.y)) + pt1.x (((-pt2.y) + pt3.y)))) ((norm.y ((4 pt3.x^2 pt1.y + 2 pt1.y^3 - pt3.x^2pt2.y + 2 pt1.y^2 pt2.y + 2 pt1.y pt2.y^2 - 3 pt2.y^3 + pt1.x ((pt3.x ((3 pt1.y - pt2.y - 2 pt3.y)) + pt2.x ((3 pt1.y - 2 pt2.y - pt3.y)))) + pt2.x^2 ((4 pt1.y - 3 pt2.y - pt3.y)) + pt1.x^2 ((2 pt1.y - pt2.y - pt3.y)) + 2 pt2.x pt3.x ((2 pt1.y - pt2.y - pt3.y)) - 3 pt3.x^2 pt3.y + 2 pt1.y^2 pt3.y + 2 pt1.y pt2.y pt3.y - 3 pt2.y^2 pt3.y + 2 pt1.y pt3.y^2 - 3 pt2.y pt3.y^2 - 3pt3.y^3)) + norm.x ((8 pt1.x^3 + 3 pt2.x^3 + 3 pt2.x^2 pt3.x + 8 pt1.x^2 ((pt2.x + pt3.x)) + pt2.x ((3 pt3.x^2 + pt1.y^2 + 2 pt1.y pt2.y + 3 pt2.y^2 + pt1.y pt3.y + 2 pt2.y pt3.y + pt3.y^2)) + pt3.x ((3 pt3.x^2 + pt1.y^2 + pt1.y pt2.y + pt2.y^2 + 2 pt1.y pt3.y + 2 pt2.y pt3.y + 3 pt3.y^2)) + pt1.x ((8 pt2.x^2 + 8 pt2.x pt3.x + 8 pt3.x^2 + 8 pt1.y^2 + 7 pt1.y pt2.y + 6 pt2.y^2 + 7 pt1.y pt3.y + 6 pt2.y pt3.y + 6 pt3.y^2)))) + 5 norm.z ((pt1.x^2 + pt2.x^2 + pt2.x pt3.x + pt3.x^2 + pt1.x ((pt2.x + pt3.x)) + pt1.y^2 + pt1.y pt2.y + pt2.y^2 +pt1.y pt3.y + pt2.y pt3.y + pt3.y^2)) pt1.z))))))
[edit]made into almost-C
-
element 2,2 looks good as well, I'm a bit worried about what's going to happen with 3,3 though
2,2:
(((1/(60 norm.z^3))(((-((1/((pnt1.x - pnt3.x))^2)((norm.z^2 ((pnt1.x - pnt2.z)) ((pnt3.x ((pnt1.y - pnt2.y)) + pnt1.x ((pnt2.y - pnt3.y)) + pnt2.z (((-pnt1.y) + pnt3.y)))) ((4 norm.x ((2 pnt1.x^3 + 4 pnt1.x^2 pnt2.z + 6 pnt1.x pnt2.z^2 + 3 pnt2.z^3)) ((pnt1.x - pnt3.x)) + norm.y ((pnt1.x^2 + 3 pnt1.x pnt2.z + 6 pnt2.z^2)) (((-pnt2.z) pnt1.y - pnt3.x pnt1.y +pnt3.x pnt2.y + pnt2.z pnt3.y - pnt1.x (((-2) pnt1.y + pnt2.y + pnt3.y)))) + 5 norm.z ((pnt1.x^2 + 2 pnt1.x pnt2.z + 3 pnt2.z^2)) ((pnt1.x - pnt3.x)) pnt1.z)))))) - ((1/((pnt1.x - pnt3.x))^2)((norm.z^2 ((pnt2.z - pnt3.x)) ((pnt3.x (((-pnt1.y) + pnt2.y)) + pnt2.z ((pnt1.y - pnt3.y)) + pnt1.x (((-pnt2.y) + pnt3.y)))) ((norm.x (((-5) pnt1.x^2 ((3 pnt2.z^2 + 2 pnt2.z pnt3.x + pnt3.x^2)) + 2 pnt1.x (((-6) pnt2.z^3 + 3 pnt2.z^2 pnt3.x + 2 pnt2.z pnt3.x^2 + pnt3.x^3)) + 3 pnt3.x ((4 pnt2.z^3 + 3 pnt2.z^2 pnt3.x + 2 pnt2.z pnt3.x^2 + pnt3.x^3)))) +norm.y ((pnt2.z pnt3.x^2 ((8 pnt1.y - 3 pnt2.y - 5 pnt3.y)) + pnt3.x^3 ((4 pnt1.y - pnt2.y - 3 pnt3.y)) + 6 pnt2.z^3 ((pnt1.y - pnt3.y)) + 6 pnt2.z^2 pnt3.x ((2 pnt1.y - pnt2.y - pnt3.y)) + pnt1.x ((pnt3.x^2 (((-5) pnt1.y + pnt2.y + 4 pnt3.y)) + pnt2.z pnt3.x (((-10) pnt1.y + 3 pnt2.y + 7 pnt3.y)) + pnt2.z^2 (((-15) pnt1.y + 6 pnt2.y + 9 pnt3.y)))))) - 5 norm.z ((pnt1.x - pnt3.x)) ((3 pnt2.z^2 + 2 pnt2.z pnt3.x + pnt3.x^2)) pnt1.z))))) + ((-((((pnt2.z - pnt3.x)) (((-((norm.x ((pnt1.x + pnt2.z)) + norm.y ((pnt1.y - pnt2.y)) + norm.z pnt1.z))^5) + ((norm.x ((pnt1.x + pnt3.x)) + norm.y ((pnt1.y - pnt3.y)) + norm.z pnt1.z))^5)))/(norm.x ((pnt2.z - pnt3.x)) + norm.y (((-pnt2.y) + pnt3.y))))) + (((pnt1.x - pnt3.x))^5 ((norm.x ((pnt1.x + pnt3.x)) + norm.y ((pnt1.y - pnt3.y)) + norm.z pnt1.z))^5 - ((norm.x ((pnt1.x + pnt2.z)) ((pnt1.x - pnt3.x)) + norm.y ((pnt1.x - pnt2.z)) ((pnt1.y - pnt3.y)) + norm.z ((pnt1.x - pnt3.x)) pnt1.z))^5)/(((pnt1.x - pnt3.x))^4 ((norm.x ((pnt1.x - pnt3.x)) + norm.y (((-pnt1.y) + pnt3.y))))))/norm.y + ((-((((pnt1.x - pnt2.z)) (((-((2 norm.x pnt1.x + norm.z pnt1.z))^5) + ((norm.x ((pnt1.x + pnt2.z)) + norm.y ((pnt1.y - pnt2.y)) + norm.z pnt1.z))^5)))/(norm.x ((pnt1.x - pnt2.x)) + norm.y (((-pnt1.y) + pnt2.y))))) + ((-((pnt1.x - pnt3.x))^5) ((2 norm.x pnt1.x + norm.z pnt1.z))^5 + ((norm.x ((pnt1.x + pnt2.z)) ((pnt1.x - pnt3.x)) + norm.y ((pnt1.x - pnt2.z)) ((pnt1.y - pnt3.y)) + norm.z ((pnt1.x - pnt3.x)) pnt1.z))^5)/(((pnt1.x - pnt3.x))^4 ((norm.x ((pnt1.x - pnt3.x)) + norm.y (((-pnt1.y) + pnt3.y))))))/norm.y))))
-
ah, not too bad after all:
(((1/(60 norm.z^3))((((pnt3.x (((-pnt1.y) + pnt2.y)) +pnt2.x ((pnt1.y - pnt3.y)) + pnt1.x (((-pnt2.y) + pnt3.y)))) ((norm.x^3 ((26 pnt1.x^3 + pnt2.x^3 + pnt2.x^2 pnt3.x + pnt2.x pnt3.x^2 + pnt3.x^3 + 16 pnt1.x^2 ((pnt2.x + pnt3.x)) + 6 pnt1.x ((pnt2.x^2 + pnt2.x pnt3.x + pnt3.x^2)))) + norm.y^3 ((4 pnt1.y^3 - pnt2.y^3 - pnt2.y^2 pnt3.y - pnt2.y pnt3.y^2 - pnt3.y^3 - 6 pnt1.y^2 ((pnt2.y + pnt3.y)) + 4 pnt1.y ((pnt2.y^2 + pnt2.y pnt3.y + pnt3.y^2)))) + 5 norm.y^2 norm.z ((3 pnt1.y^2 +pnt2.y^2 + pnt2.y pnt3.y + pnt3.y^2 - 3 pnt1.y ((pnt2.y + pnt3.y)))) pnt1.z + norm.x^2 ((norm.y ((6 pnt1.x ((pnt3.x ((3 pnt1.y - pnt2.y - 2 pnt3.y)) + pnt2.x ((3 pnt1.y - 2 pnt2.y - pnt3.y)))) + pnt3.x^2 ((4 pnt1.y - pnt2.y - 3 pnt3.y)) + pnt2.x^2 ((4 pnt1.y - 3 pnt2.y - pnt3.y)) + 16 pnt1.x^2 ((2 pnt1.y - pnt2.y - pnt3.y)) + 2 pnt2.x pnt3.x ((2 pnt1.y - pnt2.y - pnt3.y)))) + 5 norm.z ((11 pnt1.x^2 +pnt2.x^2 + pnt2.x pnt3.x + pnt3.x^2 + 5 pnt1.x ((pnt2.x + pnt3.x)))) pnt1.z)) + 5 norm.z^3 pnt1.z ((pnt1.y^2 + pnt2.y^2 + pnt2.y pnt3.y +pnt3.y^2 + pnt1.y ((pnt2.y + pnt3.y)) + 2 pnt1.z^2)) + norm.y norm.z^2 ((2 pnt1.y^3 + 2 pnt1.y^2 ((pnt2.y + pnt3.y)) + 2 pnt1.y ((pnt2.y^2 + pnt2.y pnt3.y + pnt3.y^2 + 10 pnt1.z^2)) - ((pnt2.y + pnt3.y)) ((3 pnt2.y^2 + 3 pnt3.y^2 + 10 pnt1.z^2)))) + norm.x ((norm.y^2 ((6 pnt1.x ((3 pnt1.y^2 + pnt2.y^2 + pnt2.y pnt3.y + pnt3.y^2 - 3 pnt1.y ((pnt2.y + pnt3.y)))) + pnt2.x ((6 pnt1.y^2 + 3 pnt2.y^2 + 2 pnt2.y pnt3.y + pnt3.y^2 - 4 pnt1.y ((2 pnt2.y + pnt3.y)))) + pnt3.x ((6 pnt1.y^2 + pnt2.y^2 + 2 pnt2.y pnt3.y + 3 pnt3.y^2 - 4 pnt1.y ((pnt2.y + 2 pnt3.y)))))) + 5 norm.y norm.z ((pnt3.x ((3 pnt1.y - pnt2.y - 2 pnt3.y)) + pnt2.x ((3 pnt1.y - 2 pnt2.y - pnt3.y)) + 5 pnt1.x ((2 pnt1.y - pnt2.y - pnt3.y)))) pnt1.z + norm.z^2 ((pnt2.x ((pnt1.y^2 + 2 pnt1.y pnt2.y + 3 pnt2.y^2 + pnt1.y pnt3.y + 2 pnt2.y pnt3.y +pnt3.y^2 + 10 pnt1.z^2)) + pnt3.x ((pnt1.y^2 + pnt1.y pnt2.y + pnt2.y^2 + 2 pnt1.y pnt3.y + 2 pnt2.y pnt3.y + 3 pnt3.y^2 + 10 pnt1.z^2)) + pnt1.x ((8 pnt1.y^2 + 6 pnt2.y^2 + 6 pnt2.y pnt3.y + 6 pnt3.y^2 + 7 pnt1.y ((pnt2.y + pnt3.y)) + 40 pnt1.z^2))))))))))))
-
the first product of inertia:
(((1/(120 nz ((x1 - x3))^3))((((x3 (((-y1) + y2)) + x2 ((y1 - y3)) + x1 (((-y2) + y3)))) ((nx ((x1 - x3)) ((x1^2 (((-60) x3 xy + 2 x2 ((30 xy - 8 x3 y1 - 7 x3 y2)) + x2^2 ((2 y1 - 9 y2 - 23 y3)))) + 2 (((-20) x2^2 x3 xy + 10 x2 x3^2 xy + 10 x3^3 xy + x2^3 x3 ((9 y1 + 6 y2)) - 6 x2^4 ((y1 - y3)))) + x1^3 ((9 x2 y1 - 23 x3 y1 + 14 x2 y2 - 7 x3 y2 + 7 x2 y3)) + x1^4 ((16 y1 + 7 ((y2 + y3)))) + x1 (((-80) x2 x3 xy + 40 x3^2 xy + x2^2 ((40 xy + 21 x3 y1 + 9 x3 y2)) - 3 x2^3 ((5 y1 + 4 y2 + y3)))))) + ny ((20 x2 x3^2 xy ((y1 - y2)) - x2^3 x3 ((7 y1 + 8 y2)) ((y1 - y3)) + 8 x2^4 ((y1 - y3))^2 + 20 x3^3 xy (((-2) y1 + y2 + y3)) - x2^2 x3 (((-20) xy y1 + 7 x3 y1^2 + x3 y1 y2 - 8 x3 y2^2 + 20 xy y3)) + x1^4 ((4 y1^2 + y1 ((y2 + y3)) - 2 ((y2^2 + y2 y3 + y3^2)))) + x1^3 ((x3 (((-9) y1^2 + 3 y1 y3 + 2 y2 ((2 y2 + y3)))) + x2 ((3 y1^2 + 3 y1 ((2 y2 + y3)) - 2 ((3 y2^2 + 2 y2 y3 + y3^2)))))) + x1^2 ((x3 ((x3 ((3 y1^2 - y1 y2 - 2 y2^2)) + 20 xy (((-3) y1 + y2 + 2 y3)))) +x2^2 (((-5) y1 ((3 y2 + 5 y3)) + 2 ((4 y2^2 + 7 y2 y3 + 9 y3^2)))) + x2 ((20 xy ((3 y1 - y2 - 2 y3)) + x3 (((-9) y1^2 + y1 (((-8) y2 + y3)) + 4 y2 ((3 y2 + y3)))))))) + x1 ((20 x3^2 xy ((5 y1 - 2 y2 - 3 y3)) - x2^3 ((15 y1 - 8 y2 - 22 y3)) ((y1 - y3)) + 2 x2 x3 ((x3 ((2 y1^2 +y1 y2 - 3 y2^2)) + 20 xy (((-2) y1 + y2 + y3)))) + x2^2 (((-20) xy ((y1 - y3)) + x3 ((25 y1^2 + y1 ((16 y2 - 11 y3)) - 2 y2 ((8 y2 + 7 y3)))))))))) + 5 nz ((x1 - x3)) (((-12) x2 x3 xy + 12 x3^2 xy + x2^2 x3 ((5 y1 + 3 y2)) - 3 x2^3 ((y1 - y3)) + x1^3 ((2 y1 + y2 + y3)) + x1^2 (((-x3) ((3 y1 + y2)) + x2 ((y1 + 2 y2 + y3)))) - x1 ((12 x3 xy + 2 x2 (((-6) xy + x3 ((y1 + y2)))) + x2^2 ((3 y2 + 5 y3)))))) z1))))))
-
Bobb! Stop boosting your postcount and making us all feel dumb! :p
-
you had better find some way of using this in FS2 if you're gonna do all that work.
-
Originally posted by WMCoolmon
and making us all feel dumb! :p
You said it. :p
-
Jesus. Inertia... If I recall my 8th grade science class correctly, that's the forward motion of objects after the force pushing them is gone, right? Or something to that effect? That needs to be in FS...
-
this is about rotation, it's basicly how hard it is to change an objects rotation.
-
I am assuming then that the original settings even for the [v] ships were off. considering Baseball Bat effect, and the Judo Freighters, or is it something else causing that?
-
This thread makes me feel stupid.
Good going Bob!
-
Originally posted by Carl
you had better find some way of using this in FS2 if you're gonna do all that work.
This won't get used by FS2, ever. It would go in to a converter or a tool of some kind, since the MOI is stored in the POF file (precisely because loading 9 floats is more efficient than doing all of that math). However, it's good to finally have some clue where the values are coming from.
@Flipside: maybe, but probably not. MOI is really only used when a ship gets hit by weapons fire, which is why an improper one will cause your ship or a capship to go spinning wildly after only being hit by a stray shot.
-
Hey Bob, while doing this, have you given any thought to the problem of MOI in FS2 when you have 2 (or more now) ships docked together of widely different MOI and mass? You know, dock an Isis to a Typhon, load yourself out with kinetic weaponry, fire on Isis and watch the Typhon spin like a propeller. Can you overcome this?
-
Fun fact of the day: every Freespace ship has the overall density of water.
-
and somehow the crew doesn't drown :wtf:
-
Fun fact of the night: every USN ship has an overall density less than that of water.
-
all of those currently in operation that is.
-
Originally posted by redsniper
and somehow the crew doesn't drown :wtf:
In space, no one can hear you drown.
-
Originally posted by Ghost
Jesus. Inertia... If I recall my 8th grade science class correctly, that's the forward motion of objects after the force pushing them is gone, right? Or something to that effect? That needs to be in FS...
well, hmm if i remember correctly inertia is not how long the object will move to his stop its acctually the object that trys to keep his previous stage(for example : moving in 3m/s or resting) what do slow him down: is the static\kentic powers and also the normal and the W(M*G) powers. but i probably wrong .
-
Originally posted by Fear
well, hmm if i remember correctly inertia is not how long the object will move to his stop its acctually the object that trys to keep his previous stage(for example : moving in 3m/s or resting) what do slow him down: is the static\kentic powers and also the normal and the W(M*G) powers. but i probably wrong .
Moment of inertia is an object's resistance to change in rotation.
-
Originally posted by Spicious
Moment of inertia is an object's resistance to change in rotation.
well,yes u can sum it up by that ;)
-
sort of, to actualy be more acurate it relates an objects rotational momentum with it's rotational velocity, you tell it what the current rotational momentum is and it'll tell you what it should be. this is how tops woble.
-
can you like write a caluculator that lets us imput ship dimentions amnd mass and other variables and have it output the proper moi values for us? you see, i am a moron. i can make ships look pretty, but i havent a clue how to make them spin properly.
also is there a way you can fakie newtonian physics by tweakinm moi?
-
no, dimentions are meaningless, shape is what counts.
-
Scientifically, yes. Unfortunately the way MOI is used in FS, size does have a pretty big determining factor. Shape counts, but how big the shape is also matters.
-
Size always matters in MOI, because the MOI of a point depends on its radius.
You ought to be able to get a good estimate of the MOI of a ship by finding the MOI of a bar with the same mass and length.
-
well none the les can you come up with a means to calculate moi based on an objects geometry.?
-
Originally posted by Bobboau
well holy crap, defineing the normal arbitraraly actualy made it infinitely simpler
(((1/(60 norm.z))((((pt3.x (((-pt1.y) + pt2.y)) + pt2.x ((pt1.y - pt3.y)) + pt1.x (((-pt2.y) + pt3.y)))) ((norm.y ((4 pt3.x^2 pt1.y + 2 pt1.y^3 - pt3.x^2pt2.y + 2 pt1.y^2 pt2.y + 2 pt1.y pt2.y^2 - 3 pt2.y^3 + pt1.x ((pt3.x ((3 pt1.y - pt2.y - 2 pt3.y)) + pt2.x ((3 pt1.y - 2 pt2.y - pt3.y)))) + pt2.x^2 ((4 pt1.y - 3 pt2.y - pt3.y)) + pt1.x^2 ((2 pt1.y - pt2.y - pt3.y)) + 2 pt2.x pt3.x ((2 pt1.y - pt2.y - pt3.y)) - 3 pt3.x^2 pt3.y + 2 pt1.y^2 pt3.y + 2 pt1.y pt2.y pt3.y - 3 pt2.y^2 pt3.y + 2 pt1.y pt3.y^2 - 3 pt2.y pt3.y^2 - 3pt3.y^3)) + norm.x ((8 pt1.x^3 + 3 pt2.x^3 + 3 pt2.x^2 pt3.x + 8 pt1.x^2 ((pt2.x + pt3.x)) + pt2.x ((3 pt3.x^2 + pt1.y^2 + 2 pt1.y pt2.y + 3 pt2.y^2 + pt1.y pt3.y + 2 pt2.y pt3.y + pt3.y^2)) + pt3.x ((3 pt3.x^2 + pt1.y^2 + pt1.y pt2.y + pt2.y^2 + 2 pt1.y pt3.y + 2 pt2.y pt3.y + 3 pt3.y^2)) + pt1.x ((8 pt2.x^2 + 8 pt2.x pt3.x + 8 pt3.x^2 + 8 pt1.y^2 + 7 pt1.y pt2.y + 6 pt2.y^2 + 7 pt1.y pt3.y + 6 pt2.y pt3.y + 6 pt3.y^2)))) + 5 norm.z ((pt1.x^2 + pt2.x^2 + pt2.x pt3.x + pt3.x^2 + pt1.x ((pt2.x + pt3.x)) + pt1.y^2 + pt1.y pt2.y + pt2.y^2 +pt1.y pt3.y + pt2.y pt3.y + pt3.y^2)) pt1.z))))))
[edit]made into almost-C
Ah, yes much simpler, now any of us common mortals can understand it, don't we??... :p
-
It's simple enough. It's an equation... y'know, like the pythagorean theorem or the quadratic equation. You plug in the numbers and out pops the value. I don't personally understand WHY the equation would work, but then, I flunked college physics I (PHYS151 IIRC) twice in a row, so the reasons why are beyond me. I find it interesting that only three points are referenced though... huh. And I don't know which three points to use there, but... meh. It's an equation. Plug in the values.
-
Actually this is really really overcomplicated, not to mention not really very applicable.
Newtonion inertia is most often estimated in space using an infintely small point of finite mass. So, for example, you place this point at the object CoG, and give it the mass of the entire object, and you have inertia. In fact, this estimation is generally so close that NASA most often uses it in mission planning.
Shape has no real effect outside of fluid dynamics, the only things you need are mass and CoG. Density however, does have an effect, but for the perposes here you can assume the entire object has the average density of the whole.
Check out http://www.saburchill.com/physics/chapters/0024.html for a simple MoI of a point mass.
-
so by your estimation rotateing the colosus around it's z axis would be nearly identical to rotateing it around it's y axis in terms of energy requiered.
-
Yes, because you need to rotate the entire mass anyhow. I suppose if there were huge density differences about the ship, it would make a difference, but for simplicity's sake, yes.
-
So you're saying that if you pick up a big long stick of wood (contstant density) it takes the same energy so spin it along it's axis as it does to spin it perpendicular to it's axis.
-
That's not quite what he was saying. Follow the link he gave.
-
Ah, ok i think i get what he's saying now, use just the inertia of the objects cog and distance from point of rotation to find moi? what happens when cog is center of rotation?
-
I can tell you there is huge diference in MoIs for diferent shaped objects and it makes a very noticeable diference, if you don't beleve me take a pencil, hold it by one end and spin it along it's length, then grab it from it's center and spin it perpendicular to it's length.
in the game we don't try to rotate a mass along a ridgid length (like a weight taped to a ruler) we are rotateing ridged bodies a herc's MoI is going to be radicaly diferent to a Valc's. when you rotate an object you are aplying a torqe, and the object is applying back, it comes down to this the sum of the mass of all the atom's of the object * there distance from the axis of rotation squared. if we were to represent all the objects in game as point masses, then there MoIs' would all be 0, because it's mass*r^2 were r is the distance of the point from the CoM wich because it's just a single point is 0 wich would mean the slightest feather's touch anywere on the object would instantly cause the object to start rotateing that way. from the site you yourself pointed to
http://www.saburchill.com/physics/chapters/0024.html
"and the moment of inertia of any body can be found by adding together the moments of inertia of all its component particles."
I am integrateing the MoI's across a polyhreia volume.
"M. of I. of a uniform rod of length l* I = (ml²)/3
M. of I. of a disc or cylinder** I = (mr²)/2
M. of I. of a hollow cylinder or ring I = mr²
M. of I. of a sphere** I = 2(mr²)/5"
notice how extreamly diferent all of these are.
and this is just for finding MoI for a single axis of rotation, what we need is a MoI tensor that will allow us MoI for an arbitrary axis of rotation.
now after all of this there is a simple way to aproximate MoI, you make a 3d grid and determine if the points in that grid are inside or outside the object, you add all the MoI calculations up from the points inside, divide them by the number of points inside, and bam! done.
if your looking for something to do, I'll give you detailed explaination on what all 9 elements of the MoI tensor are about (even though FS's implementation I'm still not completely sure about)
-
In one sense you're right and in another sense I am. I wish I could devote more time to the subject, but I'm on the road and my laptop battery is running low.
If you want a phenomenal source of info on the subject as relates to games, try http://www.d6.com/users/checker/dynamics.htm
It looks to be mostly integrating several point masses to get a reasonable answer. A perhaps simpler solution would be using the MoI of a cylinder, since most ship fall vaguely into that shape range. The other issue to consider is where you are applying your force, i.e. where are the manuvering thrusters located about the ship, etc.