Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

FL Rotation Calculator

Here you can find the postings on the different editing utilities found for Freelancer

Post Sat Dec 02, 2006 6:04 pm

FL Rotation Calculator

FL Rotation Calculator (FLRotCalc) is a command line utility used for determining the rotation nessacary for one object to point to another object. You enter in a first set of coordinates, and then enter in the second set of coordinates. The program will return rotational values that make the first object point to the second set of coordinates.

The most practical use of this is Tradelanes. Put the value of the first tradelane in, then the value of the second tradelane in, and then assign the resulting rotational value to all of your tradelanes. They should match up in a perfect line! Useful if you need to calculate the rotations for tradelanes that go up or down. 3D patrol paths are also an application of this.

As long as you copy the position values into the program as you see them in the INI (minus the spaces, of course), it should work like a charm. If it crashes on you, check the format of the coordinates your feeding it, and make sure there are no spaces, no weird characters, only the coordinates, a comma seperating each of the 3 coordinates, and negative signs where nessacary.

FlRotCalc (source included)

Post Sun Dec 03, 2006 3:12 am

Hmm... I entered -10000,0,-10000 and 20000,0,20000[b and it gives [b0,90,45 as output .... I'd guess it would have been 0,45,0 (or 0,-45,0 ... after all this time I still don't know when the rotation value goes into the minus ) I don't see why the middle coordinate is not 0...?

Anyway, I have no idea how to make such a tool as you have done, so: nice job! And now you're at it, maybe you might as well have it calculate the distance between the two sets? (that's pythagoras' proposition or whatever it's called in English: a*a + b*b = c*c, where in this case a is the distance between the x-coordinates, b the distance between the y-coordinates of the two sets, and c the actual distance between the two sets.

This would be convenient for calculating the traffic zones for tradelanes, and also for patrol paths. At present, I use the TradeLaneCalculator (TLCalcV2.exe), besides for calculating the actual trade lane rings, to get the right angle and calculate the distance manually... which is quite boring.

Post Sun Dec 03, 2006 3:53 am

You mean this equation Moonhead.

Distance Between Two 3D Points

The distance between two points <Ax,Ay,Az> and <Bx,By,Bz> can be found by again using the pythagorus theorem:

dx = Ax-Bx
dy = Ay-By
dz = Az-Bz
distance = sqrt(dx*dx + dy*dy + dz*dz)

It works for me every time as I'd never have figured out the length of my sloped TL traffic zones without it.

**shuffles of with a new headache**

Post Sun Dec 03, 2006 4:37 am

I have a suggestion

I made (and lost due to dead HDD) a little ap in VB that did this about two years ago, but only on a flat plane - not vertical, and didn't cross my mind for patrol paths either.

The reason was specifically for tradelanes - so you enter in the start and end coords - and it outputted the rotation as well as coordinates of the tradelane gates for you.
It would have been fairly simple to actually make it output a series of gatelane entries dependant (and automatically numbered and linked together) from a user entry.

That way it could output, essentially, a tradelane in it's entirety.

The same for patrol path, select what you're after, plonk in start and end coords, and it outputs the patrol path section for you or something similiar?

If you think of extending it blackhole, that'd be quite a handy thing to include for quite a few people i'd imagine

Post Sun Dec 03, 2006 9:29 am

Moonhead,
If working in a 3D spatial environment, The middle number in the second set of coordinates has to be different from the first set to get your "pitch" angle solution.
example:
start point = -10000, 0, -10000 (the "0" = on the level)
end point = 20000, 20000, 20000 (elevated point somewhere in space)

Solar system A is at coordinates -10000, 0, -10000
Solar system B is at coordinates 20000, 20000, 20000


Edited by - Rankor on 12/3/2006 9:55:44 AM

Post Sun Dec 03, 2006 12:40 pm

The rotational values the program gives are all accurate - the only thing that may happen is that the values could be reversed and the object would be pointing the wrong way on one of its axis in FL. This is easy to fix, however, just add/remove a negative sign.

@Chips

I'll see what i can do.

Post Sun Dec 03, 2006 2:43 pm

@ Bejaymac: yeah, I think that's what I mean but I never made paths leave the horizontal plane so I only have to use 2 sets of coordinates. (Hadn't even realized you could apply pythagoras to more than two sets... With my basic knowledge of math I would have thought you needed multiple calculations (breaking the 3d thing up into 2d triangles and do the calculations for those. Cool that it can be done much simpler.)


@ Rankor & Blackhole: now I read my post again, I get the impression I confused a few things... I was in hurry, heading for a busy day (we celebrate a festival called Sinterklaas in the Netherlands around 5 december, not unlike X-mas eve). That busy day has now ended and I am too tired to look into again. Screwed up the layout too, I see.


@ Chips: Are you familiar with the TradeLaneCalculator-V2? Some German dude made it but I can't reeber his name... His app is perfect, except it doesn't produce the traffic zone for the tradelane. Well, having it producing the hole traffic zone would have made things far more complicated (adding options for factions, encounters etc.) but just have it calculating the length would be a great improvement.

Hey, if you can do stuff in VB, you might be able to open up this tradelane calculator and add this functionality? Or is this against some ethical code (there seem to be a lot of those in the mdding scene)? (Or, you just have other and/or better things to do...)

Post Sun Dec 03, 2006 3:59 pm

Because FL uses 3 rotational values, one for each axis, i actually did not use the method above to calculate the distance between 2 points. I split it up axis by axis so that i could properly ascertain the correct values.

Post Mon Dec 04, 2006 4:27 am

@ Blackhole, got a problem with your app where TL's are concerned, this is the start and end co-ordinates and rotation for one of mine.

pos = -2324, -11500, -959
pos = -31385, 0, -26588
rotate = 15, 49, 0

Now when I add those to your app I get 21.5897, 65.8337, 48.5908

By having more than zero for the third value the TL ring is now lying on it's side, TL's and TL traffic zones only use the first 2 values. They work out as +/- 180 degrees vertical direction and horizontal direction.

I haven't used it for patrol paths yet but I can tell you that prebuilt (vanilla) or done on FLE will probably result in CTD's, as the position of patrol paths are like every other zone and refer to the center of the zone, and not it's start/end point. Any body that doesn't know how to hand build a system can forget about using your app, as there's quite a bit of work (and maths ) involved in plotting a patrol by hand.

**shuffles of with a new headache**

Post Mon Dec 04, 2006 8:07 am

If the particular zone is always referenced to it's center point...
then we would need to calculate the mid-point between begining and end to properly place it.
Wouldn't that do it?

Edited by - Rankor on 12/4/2006 8:11:09 AM

Post Mon Dec 04, 2006 4:51 pm

Ah crap, i knew something would come up somewhere. I was planning on extending the app to prebuild the patrol paths for you.

Unfortunatly i'm really busy. The source is there if anyone wants to take a crack at it, i'll probably be able to later on in the week, maybe next weekend.

Post Wed Dec 20, 2006 4:30 pm

Hi Moonhead

Any idea where this TradeLaneCalculator can be found ?

Return to Freelancer Editing Utilities Forum