|
From: Samuel C. <sam...@gm...> - 2020-09-03 16:45:41
|
On Thu, 03 Sep 2020 17:53:07 +0200 Sascha Reißner <rei...@no...> wrote: > Am Donnerstag, den 03.09.2020, 16:44 +0200 schrieb Samuel CUELLA: > > What I have done so far: > > > > --Coordinates > > I've converted some C++ code to plain C from fg to load btg files > > and meshes. In these files The documentation > > (http://wiki.flightgear.org/BTG_file_format) states that all > > vertices coordinates uses the ECEF. > > Dont know what you mean with ECEF (maybe 'Earth Center … …'). Earth Centered, Earth Fixed. Cartesian coordinate system with 0,0,0 at the center of the earth, Z up north, X at the intersection between lon 0 and the equator and Y at the intersection of lon 90° and the equator > All vertecies are *relative* to the center of the bounding sphere. > So the *absolute* coordinate of a vertex is the center of the bounding > sphere plus the vertex coordinate. Yep, that's what I have. > Your first movie looks not only like shaking, if you look at the white > marking lines it looks more as the vertecies of the mesh are jumping > around. Maybe a precition problem? Here is another video: https://vimeo.com/454441049. The "shaking" only occurs when I'm close of the mesh and I when I change the values of roll or pitch. My main problem is: I can load the mesh and render it. I can move it using rotations and translations on OpenGL axis X,Y,Z by binding these movements to keys on the keyboard. Everything gets fun beyond this. Now how could I render a terrain tile like if I was flying over it at say the center, a given altitude with 0 roll (parallel to the earth), 0 pitch (parallel to the earth) and heading north ? I couldn't find how FlightGear is doing it. The code I have to translate lat,lon alt to X,Y,Z (ECEF) seems to work (I get the right tile) but then I'm struggling with how position the "camera" to render the tile as if I was flying as said earlier. |