• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Lamps and light

Well,

The Best Way I believe to make a Model a statue is to make it part of that Location.

Anoher way, which has not been tested, is to export a model, without any locators, like a static object, and put it in ... the Items Folder <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

And then place it somewhere with the script as you would place a Sword or any other Goodie in dungeon, but make sure you don't make it something that can be picked up by the character <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
Kazimierz,

Welcome to the Site! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

Yeah we do tend to ramble, don't we, but I always take that as a sign of geniuses at work! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/type_1.gif" style="vertical-align:middle" emoid=":nk" border="0" alt="type_1.gif" />

The holidays and work, and Pirates! (just got it for Christmas!) are going to be pulling at my extremely short attention span, <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/huh.gif" style="vertical-align:middle" emoid=":huh" border="0" alt="huh.gif" /> but I would like to see if I can crack the "lamps on ships" nut before "Age of Pirates" comes out and steals my fire, or "fonar".

The more I read of the things people are finding out, the more I feel that it can be done... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />

Welcome again to the site! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> Sir Christopher, you have SMPirates now??? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" />

You know you can mod THAT game, too! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
And damn but it's addicting, too.

Regarding rotation. I think your best bet, Alan, would be to mess with the locator's rotational values.
In the tool they are reported in terms of scaling an axis along another axis. I.e. XX, XY, XZ, YX....ZZ
Normally XX, YY, and ZZ are 1.0 and the rest are 0.0; if you want to rotate you set one of the normal ones to less than 1 and the direction you want the object to rotate towards (i.e. positive X->positive Y) to >0.0.

I don't think I entirely understand how it works, though; Inez, we'd be much obliged if you expounded on that.
 
I'm not sure I understand all of this myself - here's what I believe to know:
the XX, XY etc. define the three axes of a coordinate system at which (presumably) any object you attach to the locator will be oriented in:
XX, XY and XZ define the `X-Axis` (in world coordinates),
YX, YY and YZ the `Y-Axis` and
ZX, ZY, ZZ the `Z-Axis`
(which I think is what you're saying, too, Nathan).
Each of the three axes should be normalized, meaning the sum of, e.g, XX squared + XY squared + XZ squared is 1.

The standard values (XX, YY and ZZ being 1 and the rest 0) mean that the locator's X axis is parallel to the world's X axis, Y to world's Y and so on.
Making, for example,
XX=0, XY= 1, XZ=0,
YX=0, YY=0, YZ=1 and
ZX=1, ZY=0, ZZ=0
would mean the locator's X Axis is parallel to world's Y Axis, locator's Y to world's Z and locator's Z to X.
Of course `non-zero` values for all three are possible, as long as the sum of the squares is 1, however I can't calculate that in my head. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
I wish I could explain this better, but my mental orientation in `3D-space` is lousy.
 
Ah, squares. Right, I was stuck on addition.

Heh--you figure they went this route to optimize speed? I.e., this is just a way of precomputing angular rotation to a transform matrix, while also adding in scaling.
(If I got the terminology correct)

I.e. rather than having to do trig each time to get new coords from a rotation, and only then multiplying by each axis's scale, it simply multiplies each coordinate component by the appropriate numbers in the matrix, sums the three subvalues, and spits out the new coord value.
n = new, o = old.
Xn = Xo * XX + Yo * YX + Zo * ZX
Yn = Xo * XY + Yo * YY + Zo * ZY
Zn = Xo * XZ + Yo * YZ + Zo * ZZ

So in sum this is just a way of expressing rotation as scaling, i.e. "precomputing" rotation.
-=-=-=-
I mean, I know they work for plain `non-rotational` scaling, including mirroring. And thank goodness but it actually mirrors the normals too.
-=-=-=-
So we'd need some kind of program to convert the standard form of six values (a rotation component and a scale component for each axis) to the POTC form of nine values.

My vector math is kinda rusty, but it seems to me that we should be able to write a conversion formula, right?

{Or, hell, just reverse engineer the export plugin. Make a locator in maya with some rotation and then export it and check the values.}
 
I don’t think there’s any scale (what would a locator need scale for?) - if there was, the squares would not add up to 1.

And why you’d prefer three rotations to nine coordinates I’m not sure, but if that’s what you want: for a subsequent rotation of c around the `x-Axis`, b around the `y-Axis` and a around the `z-Axis` you get:

XX= cos(a)cos(B),
YX= sin(a)cos(B),
ZX=-sin(B)

XY= cos(a)sin(b)sin©-sin(a)cos©,
YY= sin(a)sin(b)sin©+cos(a)cos(a)
ZY= cos(b)sin©

XZ= cos(a)sin(b)cos©-sin(a)sin©,
YZ= sin(a)sin(b)cos©-cos(a)sin©
ZZ= cos(b)cos©

I seem to have lost track of what we were originally trying to do <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />
 
I'm just fooling with the X, Y, Z's randomly. I find if I set some to negative, I get an "`inside-out`" model... like, I tried it with a cannon for instance, and it was like the barrel was concave instead of convex; and the outside part of the wheel was sort of on the inside. Hard to explain without pictures, and I didn't consider it worth taking pictures of.

I'm trying to get a sword, modelled on the horizontal plane, to stand up vertically. Just guessing blindly on the rotation values... I can make it ~45 degrees tilted, but not ~90. The max values for each number is -1 and +1, right? I tried all 3s once, and the model didn't quite show... just a huge, thin sliver.
 
I would guess that for 90 degrees you need make one in each group of three 1 and the other two 0.
If the orignial values are not what you want that leaves you with

0 1 0
0 0 1
1 0 0

or

0 0 1
1 0 0
0 1 0
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sick.gif" style="vertical-align:middle" emoid=":eww" border="0" alt="sick.gif" /> Stop, I'm having high school algebra flashbacks! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/ko.gif" style="vertical-align:middle" emoid=":ko" border="0" alt="ko.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

I wish I had more time to look deeper into this - been really busy lately... But I want to learn it because I want to see how it all works. Thanks for the publicly posted thoughts on this (so glad we openly share!), as it will help me learn it in the long run... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
After some of my own experiments I'd make a new guess: to turn something from horizontal to vertical you need to either
rotate around z:
0 1 0
-1 0 0
0 0 1 (last row unchanged because rotating around z)
(try other combinations of 1 and -1 in the first two rows also)

or

rotate around x:
1 0 0 (first row unchanged because rotating around x)
0 0 -1
0 1 0
(try other combinations of 1 and -1) in the last two rows also)

The above matrices are

XX XY XZ
YX YY YZ
ZX ZY ZZ

in the tool's locator editor
 
Back
Top