|
From: Samuel C. <sam...@gm...> - 2020-11-15 07:54:26
|
On 04/09/20 20:25, Sascha Reißner wrote: > Am Freitag, den 04.09.2020, 18:54 +0200 schrieb Samuel CUELLA: >> On Thu, 03 Sep 2020 19:40:37 +0200 >> Sascha Reißner <rei...@no...> wrote: >>> I dont know if it calculate also the local orientation, but thats >>> not >>> difficult to do. I remember some matrix calculation in the code, so >>> i >>> have played with rotated coordinate systems. >>> >> I couldn't find it yet. I used a PDF document that explained the math >> to go from a cartesian ECEF to local NED (North East Down) vectors >> which gave me some results but not perfect. > > The code need it to calculate the correct orientation of the approach > light system if you change or build a new one. > I think its the function 'projection' in vertex.c on line 231. > It takes the bounding sphere as local center and calculate the X/Y/Z > location of the vertex based on the local center and local orientation. > This will be stored in the vertex.projection.[x|y|z]. > So vertex.projection.[x|y|z] is a localized coordinate where X and Y > build a horizontal plane (Y point to north) and Z is straight up. Hi list, A big thank you for pointing me in the right direction. For the record, I had three issues: -Incorrect conversions between coordinate systems, solution was to use logic from View::recalcLookFrom. -Incorrect geometry: I had hiccups in my mesh-building code -The math lib I'm using had only float matrices/quats. I added a bare minimum support for doubles where I needed it, and voilà ! While doing the testing, I ended up writing a FGTape reader to replace the FG instance I had running on another computer. I'll do a separate post for whoever could be interested in it. Best, Samuel |