glob3mobile / g3m

The multiplatform advanced visualization framework
http://www.glob3mobile.com/
Other
116 stars 56 forks source link

Artificial Horizon #158

Open Matyooo opened 8 years ago

Matyooo commented 8 years ago

Is there an easy way to calculate the exact position of the horizon line, knowing the Planet and the Camera?

machanguillo commented 8 years ago

Hi @Matyooo: do you mean the position on the screen (in pixels)? And I suppose you are not assuming elevations on the terrain, just the geometry of the planet.

Matyooo commented 8 years ago

Yes, that is exactly what we would like to calculate, although we realized in the meantime that real life artificial horizons never show the actual position of the horizon, but it would be nice to know anyhow....

machanguillo commented 8 years ago

OK. We could think and write a method that returns the projection of the horizon in pixels. In the case of flat planet, or when camera is not too high, this projection looks like a straight line on the screen. In the rest of cases, the problem is a little bit more complex

akosmaroy commented 8 years ago

this would be great

we're aware that this is a bit complex in the case when the altitude is not close to MSL. in that case, we're interested in where 'level' would look like in the distance. that is, we're not interested in where the horizon line would be, but we're interested in where the middle line of the screen would be if the camera is 'level' (parallel to the surface)

machanguillo commented 8 years ago

Hi @akosmaroy. I don't understand your question: "where the middle line of the screen would be...". I have drawn some figures (see attached pdf). The first slide is the first question from @Matyooo. We can add a method to compute that: where in the screen is the horizon line. The second slide is about your question, for the case of a flat planet: if camera pitch is zero, horizon line is always in the middle of the screen. The third slide is your same question, for the case of a spherical planet. What do you expect as result? where do you think the middle line of the screen is located? Horizon line.pdf