EarthManipulator: Boudingbox view

classic Classic list List threaded Threaded
8 messages Options
olivier olivier
Reply | Threaded
Open this post in threaded view
|

EarthManipulator: Boudingbox view

Hi,

I want to position my camera (with EarthManipulator by example) in order to see a boundingbox.
I have in input 2 points of the bouding box.

my final goal is to be able to see this bounding box all over the window with an angle of 30 °.

Any idea ?

Thanks :)
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

Olivier,
Please consider the osgEarth::Util::ViewFitter class.

Hope this helps!
Glenn Waldron / Pelican Mapping
olivier olivier
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

Thks, its what I need :)

But when I use this method, the view is "too small".

I miss part of it, as if there was a margin on all sides
I have to zoom out a little bit to see the two points of my bounding box.

Have you an idea ?
(I can't use the method setBuffer because the size of my bouding box is unknown)

Thks
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

Olivier,
How can the size of your bounding box be unknown?
Glenn Waldron / Pelican Mapping
olivier olivier
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

ah yes an error on my part, forget ...

what I do not understand is that in the ViewPoint that I get, the two points of the bounding box are "out of frame"
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

Olivier,
If you think there's a bug, we will need a test case we can use to reproduce what you are seeing. A simple standalone cpp would be ideal. If you can post a GitHub issue with the sample we will take a look. Thanks!
Glenn Waldron / Pelican Mapping
olivier olivier
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

Hi,

I found the solution. The reason was the "heading" value of the viewpoint created.
If my camera is not oriented to the north, it doesn't work.

To fix this issue, I add "viewpoint.setHeading(0);".

I don't know if it is bug or if it is the correct behavior, not adapted for me.

Thanks a lot for the support.
see u :)
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator: Boudingbox view

Thanks Olivier, this makes sense!
Glenn Waldron / Pelican Mapping