Hi Robert,

Thanks for your reply. Yes I realise the problems inherent in making an
orthogonal view behave like a perspective view.

What I'm trying to do however is create a plan view on a CAD like
application for oil rigs. So imagine in perspective view you can move around
the rig, in plan view you want to see it top down, everything's in
wireframe, sort of like a blueprint.

I need the ability to zoom in the plan view, but not rotate or move
forwards/backwards, literally just pan/zoom.

I noticed osg::Camera offers more direct access to the view/projection than
the camera manipulator (which only affects the View), so I've dumped camera
manipulator and created two cameras - perspective / plan.

Then I am directly updating the camera in the perspective/plan mode from my
own event handling code. (In addition I need multiple other cameras that I
can position around the scene in perspective mode and switch to on various
key presses).

One problem - I am trying to swap the cameras in/out of the osg::Viewer so I
was using osg::Viewer::setCamera and getCamera to get/set the default
camera, however it is not behaving as expected.

Is this the right way to set the default camera?

I just one one to render at a time, not to composite the view. If I sort the
orthogonal code (Plan view) I'll post it here for reference purposes.

Thank you,
Andrew


On Wed, Aug 5, 2009 at 8:23 AM, Robert Osfield <[email protected]>wrote:

> Hi Andrew,
>
> I would not recommend trying to make an orthographic view behave like
> a perspective view, it simple doesn't work (this is not an OSG issue,
> but the basic principles involved.)  I've written about this before so
> I won't waste my key presses have a look through the archives.
>
> The upshot is I would suggest keeping orthographic views for fixed
> maps/side/front views, or very constrained user interaction models.
> If you try to make a orthographic behave like a perspective you'll
> just waste lots of time.
>
> Robert.
>
> On Thu, Jul 30, 2009 at 6:22 PM, Andrew Thompson<[email protected]>
> wrote:
> > Hi there,
> >
> > I am using a custom CameraManipulator class (inheriting
> osgGA::MatrixManipulator) which is added to my scene after the
> OpenSceneGraph is initialised
> >
> > The CameraManipulator has two member variables I've added, a Vec3d target
> and position. These are used to create a projection matrix by calling
> Matrix::makeLookAt. As the events are handled by the manipulator, I am
> updating the position/target and recomputing the matrix, then on Frame I am
> returning the constructed matrix.
> >
> > This provides a great perspective view, however I cannot work out how to
> construct an orthogonal projection using a target/position.
> >
> > In addition, I'd like to be able to change the Field Of View when I
> create the matrix.
> >
> > I realise there is a Matrix::makeOrtho and Matrix::makePerspective,
> however I'm not sure how to use these with my CameraLocation/Target
> variables.
> >
> > Could anyone offer me some advice?
> >
> > Thank you!
> > Andrew
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=15659#15659
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to