Question

I try to write my own application-interface for Google earth (c++). I am using Earthlib to control camera (EARTHLib::ICameraInfoGE). This interface allow to control camera's longitude, latitude, etc. Example:

EARTHLib::ICameraInfoGE* pCamera;
double shift = ...
....
pCamera->PutFocusPointLongitude(pCamera->GetFocusPointLongitude() + shift);//new longitude
ge->raw_SetCamera(pCamera, 1.0);

But when i make many 'PutFocusPointLongitude' with small 'shift' my moving is shaky. ( big shift are not satisfied me). Are there some way to control camera's moving like native GE control?

PS Sorry for my writing mistakes. English in not my native language.

Was it helpful?

Solution

There are a couple of things you can do here:

  1. "Teleport" to the desired location. Its been a while since I used the COM API, I can't remember if you can pass a speed to the set camera function or not. If you can, the teleport speed is anything >= 5.0. If you can't, you can definitely set the global go-to speed to 5.0 or higher

  2. If you're trying to create a "rotating earth" type thing, you can call the function to change the view very rapidly (say, 60Hz, e.g., 60 times per second) and move the camera very little during each update. This will create a "rotating earth" type effect.

  3. If you aren't trying to do a rotating earth type thing, you can use the same principal as number (2) to fly to smooth the flying to your destination

  4. You could switch to using KML tours, but unfortunately you can't start/stop them using the COM API. This has been broken for a long time and I don't think Google will fix it since the COM API is deprecated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top