Hi there,

I need some explanation about FGTileEntry::WorldCoordinate.
Its parameters are :
- sgCoord* obj_pos, must be the computed coordinates (cart + hpr)
- Point3D center, guess it is an offset in cartesian coord
- double lat, must be the lat (in deg) of the point to convert
- double lon, must be the lon (in deg) of the point to convert
- double elev, must be the elevation (in m) of the point to convert
- double hdg, must be the heading of my object located at lat, lon elev

Tell me if I am wrong at this point ... hope not :D

First, I see that in this method the starting location is converted in cartesian
coord (sgGeodToCart), but what surprised me is that in the construction of this
point lat and lon are inverted ... don't know why for the moment.
Before I looked to this method here is what I was doing.

What I want to do is to compute a geod location of an object attached to another
which I only know the location in lat/lon/z. Lets talk about an aircraft and its
missile. Here is how I started to do.
I tried to determine how the axis were placed using special geod coord and
converting them into cartesian. I guessed that :
- X is from the center of the earth to lat 0, lon 0 (equator, meridien of
greenwich)
- Y is from the center of the earth to lat 0, lon 90 (equator, east)
- Z is from the center of the earth to lat 90, lon 0 (north pole)

Is it still right at this point ?

Then to compute the cart coord of the missile I intended to compute a
mark_shifting matrix with :
- a rotation around Z axis of an angle of "lon"
- a rotation around Y axis of an angle of "90-lat"

Then I computed the transposed matrix of this : mark_shifting_transposed.

I created my local_transformation matrix using missile_deltaX, missile_deltaY,
missile_deltaZ, aircraftH, aircraftP, aircraftR.

Then, I computed my global transformation matrix as follow : 
mark_shifting * local_transformation * mark_shifting_transposed

Then I guessed that I could compute my cartesian cooord of the missile by
multiplying this transformation matrix with the cartesian coord of the aircraft.
But I get strange results ... (if I use only one delta, sometimes I get a
translation composed on 2 axis)

It's been a long time since I practices maths... too long...
Could anybody explain me maybe how I get wrong, and maybe a better way to
compute what I want ?

Thanks (a lot) in advance.

David



_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to