This really doesn't seem like such a difficult subject to me.
If one were to use a crude approximation of a flat plane drawn out to intersect the ray from the eye to the sun, it would work, but...


If you want to be really clever, use a spherical or spheroidal approximation to determine where the ray (vector) from the sun to the eye intersects the earth (if it intersects). At this point, all you really have to do is detect whether the ray from a few key points of the sun (bottom, top, center) to the eye intersect the arc of the Earth.

Similarly, you can probably just use the spheroidal formulae's (which I've noticed a bit of lately) calculations to do a possible trick. If you calculate the tangent line from the sun's center to the Earth's limbs, the absolute angle between either of these tangents (they'll be equal) and the line between the centers of the earth and the sun will represent the largest possible angle which the sun cannot be seen by anything (since an angle smaller than this critical angle is behind the earth). Obviously, if the eye is somewhere directly between the earth and the sun, this calculation needs not be done. I have a nice little picture with the diagram of what I'm referring to, but I don't know if an attachment will work.

If it does, it's just a gif image. In the image, Theta is the angle from the centerline of the sun to the Earth's limb. Alpha is the angle from the sun's centerline to the viewer (a little airplane). The centerline passes through the center of both the sun and earth.

Pseudocode:

{ If the absolute value of alpha is less than the absolute value of theta, then check and see if the eye is between the earth's center and sun's center (not directly on the centerline, just somewhere near it, more or less check to see if the eyepoint is between the earth-center-X-coord and the sun-center-X-coord). If it's within this range, then the sun is visible if the user looks at it
} else {
if alpha is greater than theta, then the sun should be visible if the user looks at it.
}
End pseudocode.


Not too shabby, but it probably has holes. I do know that the last time I checked, FG will display the sun at midnight, especially if you fly up high enough, even if the earth is actually in the way, as in directly in the way.

JD

Danie Heath wrote:
If I can give my opinion, 1 mile visibility sometimes looks like 20 mile
visibility when your only a mere 3000 ft up in the sky ... It's a really
a difficult subject this....

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brandon
Craig Rhodes
Sent: 26 November 2003 08:53 PM
To: [EMAIL PROTECTED]
Subject: [Flightgear-devel] Re: the horizon


As I continue to ponder my horizon ideas, I am driven to ask: is the FlightGear visibility code perhaps too naive? In real life, if you are ten miles up looking down on landscape with fifteen-mile visibility, do you really only see a little five-mile-radius patch? (And: is this what the current visibility model does, or have I just pushed it too hard and misunderestimated its sophistication?)



--
A scientist claims in court that the reason he ran a red light is that, due to his speed, the color was blueshifted till it appeared green. Needless to say, the charges of running the red light were dropped and he lost his license for speeding excessively.

<<inline: Earth Sun Airplane.gif>>

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to