Caduceus parameters

News and discussion of the PC port of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

Caduceus parameters

Post by Alex »

Hi Commanders,
I was wondering if anyone could tell me what the parameters for the turret guns are about.
<key>subentities</key>
<array>
<string>caduceusturret 8.5 -0.2 46.6 1 0 -1 0</string>

I guess the first are XYZ coordinates for fied of fire?? maybe. but the last 2 or is it 4? (1 0 -1 0) Think it's 4 coz the spaces.

I'm a total newbe at playing around with the code so any help would be great.

Happy Hunting
Al
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

First three are its position on the model (relative to the model's centre) and the last four are a quaternion indicating which way it should face.

Further reading (on the wiki):

Subentities.
Quaternions.

plus a whole host of web pages on the latter (Google is your friend).

Enjoy ;)
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Post by Diziet Sma »

Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

Post by Alex »

Err... Thanks Commanders,
Thought I was done with calculus 20 years ago.
Wonder if I still have they old text books?
I'll give the stuff you put me on to a read through and see how much I've forgot.

Happy hunting
Al
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

However, the most important link would be to the documentation of shipdata.plist:

http://wiki.alioth.net/index.php/Shipdata.plist

which doesn't only tell you what the seven numbers are for, and links you to understanding what vectors and quaternions are, but also answers all your other question about anything you find in shipdata.plist. :wink:

Really, it is worth looking into the documentation. People have written the Elite Wiki, so that newbies get everything on a silver platter. :wink:
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Commander McLane wrote:
However, the most important link would be to the documentation of shipdata.plist:

http://wiki.alioth.net/index.php/Shipdata.plist
...which is why it's the first of my two links above, going specifically to the subentities entry on said plist ;) .

But the advice to read and inwardly digest the wiki is spot on the credits, and vital to understanding what's going on under the surface of the game.
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2514
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

If you do need a handy dandy xl Quaternion calculator. Follow my signature link.
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

Post by Alex »

I know this will be a really silly Q. But are ships built along the X or Z axis? And do the given dimensions relate directly to the same coordinates?

<key>weapon_position_aft</key>
<string>0.0 9.058021 -44.120069</string>

In my thinking the 0.0 says it's dead centre aft then 9.05 up the tail, but then -44.1?? put's it wayout on the left tail wing as looking at the ship from the back, assuming it's built along the X axis??

Still haven't got my head around the W,X,Y,Z thing yet. There isn't an idiots guide is there?
Haven't done any real math sice I left tech collage about 83. bearly remember what cos sin tan are.

As you may have guessed, I'm trying to replace my aft M.laser with a couple of turrets.
Absolutly hopeless trying to fire back, can't seem to get my head around doing it in reverse, only been trying for a year and not getting any better.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Alex wrote:
I know this will be a really silly Q. But are ships built along the X or Z axis? And do the given dimensions relate directly to the same coordinates?
Ships nose is Z and top is X. (I can't remember were Y points :? )
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Eric Walch wrote:
Alex wrote:
I know this will be a really silly Q. But are ships built along the X or Z axis? And do the given dimensions relate directly to the same coordinates?
Ships nose is Z and top is X. (I can't remember were Y points :? )
Half-right I'm afraid...

If you imagine you're sitting in the cockpit of the ship facing forwards, the axes are as follows:

X - left-right (wingtip to wingtip), +X is to the right/starboard.
Y - up-down (top to bottom), +Y is upwards.
Z - front-back (fore to aft), +Z is forward towards the nose (as Eric says).

Basically they're a standard cartesian co-ord set, with the ship pointing along +Z and the other two at right-angles to that.

So your <string>0.0 9.058021 -44.120069</string> is dead-centre along X (middle of the ship horizontally left-to-right), a little over 9m along Y (up above your head) and -44m along Z (back of the ship near the aft/tail).

As to quaternions, the links already provided are about as simple as it gets. Start with the Oolite wiki page and the wikipedia one, and then if that doesn't have your brain crawling out of your ears and begging for mercy then venture further afield on t'internet. Also ClymAngus's aforementioned Excel sheet is highly useful here, both for calculations and just playing around to try and understand the damn things.

Oh and one final tip, don't be afraid to just use your fingers, start by pointing forward (along Z) and then do your rotations individually and see where you end up pointing to. Also remember to only rotate in one axis at a time, and that the order of doing the rotations if you're doing multiple is important (try it and see using the finger-pointing method).
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

Post by Alex »

Thanks Thargoid,
Now the wiki pages make a lot more sense and explains why I didn't seem to be able to get the thingies in the right place. Don't know why I assumed the main direction axis to be X.

Your not far wrong about the quaternions, just trying to spell it almost makes my brains bleed.

I like the finger pointing idea, tried it straight away and makes the axis rotations seem a lot more obvious.
Well bake to trying to understand the quaternion thingies.

Happy hunting, well err.. maybe not so happy for thargoids though...
Al
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

Post by Alex »

BING
Light finally went on.
recon it was using the finger pointing that done it.
Thanks guys.
just need tosee if I can make it work now.

Happy hunting
Al
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2514
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

Try redirecting an exterior camera some time. Now that's what I call fun and games with object positioning quaternions and spatial rotation.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Amazing what waving your hands around like a loon can actually achieve in these circumstances.

Also the other thing to remember is when you're rotating around an axis, your co-ordinate in that axis doesn't actually change. For example if you're rotating around X, it's equivalent to moving the nose of the ship up or down (pitching). So the co-ordinate of the tip of the nose (for example, applies to any point) will change in Y and Z, but not X.

Simplest way to think about it is by holding a pencil or something like that in your hand to signify the axis you want to rotate around, and then go handwaving again...
Post Reply