Roman,
If you know the light posns in runway (object) coords all you need to know
is the lat, lon and alt of the centre/corner (0,0,0) of the runway.
Construct transformation matrix as is done for dynamic objects in main.cxx.
Rotate first for lat, lon and translate by Objtrans (see below).
//object gbs-posn in cartesian coords
Point3D obj_posn = Point3D( obj_lon,obj_lat,obj_alt);
Point3D obj_pos = sgGeodToCart( obj_posn );
// Translate object w.r.t tile center
Point3D Objtrans = obj_pos - tile_center;
This should work. This can be done offline and stored in a seperate file or
done on the fly.
Regards
Ranga
-----Original Message-----
Okey guys, I'm trying to implement runway lights but I have some
mathematical trouble:
I know 4 corners of runway in local tile coordinates O1 O2 O3 O4 {x,y,z}
And I have runway sheme of lights for example let O1 will have {100,100,100}
in FG coordinates and {0,0,0} in local lights coordinate system. All I need
to have formulas to convert this local lights coordinates to tile fg
coordinates. I know that I can construct plane by 3 points using plib sg
routine but wthat formulas?
O2 O3
y
|
0------0--------0
| |
| |
| |
0------0--------0-->x
O1 O4
so in runway coordinate system we have 6 points
{0,0,0}{100,0,0}{200,0,0},{0,50,0},{100,50,0},{200,50,0} and have simple
routine to convert it to tile coordinate system
I try many formulas but no success :((
So if some on do it we HAVE runway lights
because you simply construct it using tileentry.cxx routines
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel