Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Possible "Flight Path"?

Ward Goodnight
Registered User
Join date: 23 May 2006
Posts: 23
05-30-2006 13:18
I'm wondering if anyone has tried making an object follow a preprogrammed "flight path"? Basically entering X,Y, and Z coordinates for waypoints, and it just goes from one to the next. I know it's been done with prims as waypoints (elevators and stuff), but this requires permission to create a prim on or over the parcel. If I could enter a series of coordinates and have an object automatically move from one to the next, then I could create flight paths across the entire world. Any thoughts?
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
05-30-2006 13:20
This should be possible. If combined with the warppos code that is now possible, you could conceivably set a "highway" of sorts of way points.

I haven't done this (yet) but I've heard there can be problems when moving across sims. Try it, see what happens.
Mendacio Montgomery
Registered User
Join date: 12 May 2006
Posts: 13
05-30-2006 13:20
I'm working on a script that does that at the moment with natural bank angle. I will let you know when it's done.

Alternatively, I will give you the recipe, if you're interested.

Essentially, three way points define a curve. The distance between each point represents the speed and the angle between the segments that connect them represents curvature.

Using these two properties (speed and curvature) you can derive a bank angle and a heading.

Good luck. ;-)

M.
Ward Goodnight
Registered User
Join date: 23 May 2006
Posts: 23
05-30-2006 13:26
I'm not immediately concerned with speed or curves, just simple waypoint-to-waypoint style navigation, similar to the way aircraft follow VOR's. I suck at math, so I can't devise a way to calculate the needed vector to get to the next waypoint. Once the vector is known, I'd simply find the Differences (X/Y, and Z) between the new vector and the current vector, which should determine the amount of pitch and roll needed.
Mendacio Montgomery
Registered User
Join date: 12 May 2006
Posts: 13
05-30-2006 13:31
I believe my script already handles what you're looking for. I don't have it with me at work - but I will lookf for it this evening. I tend to use it a little differently though. I supply a mathematical curve and it derives the way points that you say you'll provide. It then tracks the mathematical curve according to said derived waypoints. The issue I've had is that I am not aware of any way to address a point in a sim other than the current one. As far as I know you may cross sim borders effectively using the coordinate system, but only as a relative hop from say the eastern edge of one sim into the western edge of the sim to the right of it. It would be great to identify a unique point using the sim name and the coordinate vector. ie. <Ahern,<25,45,30>>, for example. But I don't believe this can be done :-(.
Mendacio Montgomery
Registered User
Join date: 12 May 2006
Posts: 13
05-30-2006 13:36
If all you need is the mathematics then here it is:

given three points in your flight path:

A:<1,4,6>
B:<2,6,6>
C:<4,5,7>

Then A to B is a vector defined by B-A which is <2,6,6> - <1,4,6> which is <1,2,0>

and B = A + (B-A)

so B = <1,4,6> + <1,2,0>

So for your plane to get from A:<1,4,6> to B:<2,6,6> it's relative path with respect to A is <1,2,0>.

Similarly, C is at <2,-1,1> with respect to B.

M.