EarthManipulator on pre-render camera

classic Classic list List threaded Threaded
5 messages Options
Adam Adam
Reply | Threaded
Open this post in threaded view
|

EarthManipulator on pre-render camera

Hey guys,

Kind of an odd question, and not exactly osgEarth specific, but is there a way to use the EarthManipulator to position and rotate a pre-render camera?

Basically I want to render the earth to a texture allowing the user to specify the coordinate to center on in lat/long.  I know I could basically copy/paste the matrix manipulation the EarthManipulator does, but I was hoping I wouldn't have to.

Thanks,
Adam
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator on pre-render camera

Hey Adam,

Sounds like a cool idea.  I've never done anything like that
personally, but it sounds doable. What you basically need to do is map
where the user clicks on your quad into the pre-render camera's space
and then use an EarthManipulator to set the view matrix of the camera
based on their clicks.  You might be able to look at the
InteractiveImageHandler in OSG for some inspiration.

Thanks,

Jason

On Thu, Feb 18, 2010 at 4:47 PM, Adam [via osgEarth]
<[hidden email]> wrote:

> Hey guys,
>
> Kind of an odd question, and not exactly osgEarth specific, but is there a
> way to use the EarthManipulator to position and rotate a pre-render camera?
>
> Basically I want to render the earth to a texture allowing the user to
> specify the coordinate to center on in lat/long.  I know I could basically
> copy/paste the matrix manipulation the EarthManipulator does, but I was
> hoping I wouldn't have to.
>
> Thanks,
> Adam
>
> ________________________________
> View message @
> http://n2.nabble.com/EarthManipulator-on-pre-render-camera-tp4594572p4594572.html
> To start a new topic under osgEarth, email
> [hidden email]
> To unsubscribe from osgEarth, click here.
>
Adam Adam
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator on pre-render camera

Jason,

Thanks for the tips.  How could I use an EarthManipulator to set the view matrix of a pre-render camera?  I've only been able to set the manipulator for a viewer's camera.

Thanks,
Adam
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator on pre-render camera

Hey Adam,

You can do this:

_camera->setViewMatrix(_cameraManipulator->getInverseMatrix());

Basically what I was thinking was that you would have a little shim
like InteractiveImage that maintains it's own EarthManipulator.  When
something happens like a click or drag in that shim, you pass it along
to the EarthManipulator with the handle() function.  Then you can call
getInverseMatrix to get the view matrix for your camera.

Jason

On Fri, Feb 19, 2010 at 1:38 PM, Adam [via osgEarth]
<[hidden email]> wrote:

> Jason,
>
> Thanks for the tips.  How could I use an EarthManipulator to set the view
> matrix of a pre-render camera?  I've only been able to set the manipulator
> for a viewer's camera.
>
> Thanks,
> Adam
>
> ________________________________
> View message @
> http://n2.nabble.com/EarthManipulator-on-pre-render-camera-tp4594572p4599418.html
> To start a new topic under osgEarth, email
> [hidden email]
> To unsubscribe from osgEarth, click here.
>
Adam Adam
Reply | Threaded
Open this post in threaded view
|

Re: EarthManipulator on pre-render camera

Jason,

Ahhhh ok, thanks for the tip.

-Adam