glob3mobile / g3m

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

How to get the current Camera Position? #126

Closed WuhanMonkey closed 8 years ago

WuhanMonkey commented 8 years ago

Using g3mWidget_iOS. How can I get the current camera position include (Geodetic3D *position), heading and pitching? In g3mWidget.hpp, there is function called getCurrentCamera(). How would I be able to call it from g3mWidget_iOS class?

Thanks

DiegoGomezDeck commented 8 years ago

Hi @WuhanMonkey

G3MWidget_iOS is an (incomplete) wrapper to G3MWidget. G3MWidget is the multi-platform piece of the G3M Widgets. From the iOS widget instance, you can get a pointer to the multi-platform widget:

G3MWidget* g3mw = g3mWidget_iOS.widget;

And from there:

const Camera* camera = g3mw->getCurrentCamera();
const Angle heading = camera->getHeading();
const Angle pitch = camera->getPitch();
const Geodetic3D pos = camera->getGeodeticPosition();
DiegoGomezDeck commented 8 years ago

Hi @WuhanMonkey, did it work? can I close this issue?

WuhanMonkey commented 8 years ago

Yes it works. Please close it.

Thanks

On Thursday, September 17, 2015, Diego Gomez Deck notifications@github.com wrote:

Hi @WuhanMonkey https://github.com/WuhanMonkey, did it work? can I close this issue?

— Reply to this email directly or view it on GitHub https://github.com/glob3mobile/g3m/issues/126#issuecomment-141109183.

Chengpeng(Chester) Hu

University of Illinois-Urbana Champaign

Major in Computer Engineering | Department of Electrical and Computer Engineering

Research Assistant in Liu Nanobionics Lab

hu43@illinois.edu hu43@illinois.edu