jordoncm / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

GEView::copyAsLookat does not respect altitude value #343

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I specify a LookAt view that looks at a point in the air (not on ground), 
the
lookat is not respected when I subsequently calls a
GEView::copyAsLookat(ge.ALTITUDE_RELATIVE_TO_GROUND).

For example I specify:

    var lookat = ge.createLookAt("mycamera");
    lookat.setLongitude(2.335874101400782);
    lookat.setLatitude(48.86098846412956);
    lookat.setAltitude(15);
    lookat.setHeading(0);
    lookat.setTilt(90);
    lookat.setRange(45);
    lookat.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_GROUND);

Then when I call 
GEView::copyAsLookat(ge.ALTITUDE_RELATIVE_TO_GROUND).

I get (after the camera has positioned):
Longitude =2.335874101400782
Latitude =48.86098846412956
Altitude = 0
Heading = 0
Tilt = 90
Range = 2124.638287747817
AltitudeMode = 1

It always result in an altitude that is 0 and some large range when my Tilt is 
close
to 90.

It seems that it projects the specified lookat point to the ground surface. 
Hence
when requesting the lookat point again the altitude is zeroed, and the range is
then a very large value.

Original issue reported on code.google.com by j...@gavia.dk on 5 Oct 2009 at 12:46

GoogleCodeExporter commented 9 years ago
Ah ha, funny that. I spend a while trying to figure out an issue I had in my 
code but now I read this I am convinced that was the issue for me too. "Myth 
Confirmed"

Original comment by vandint...@gmail.com on 30 Oct 2011 at 6:26