[osg-users] Ortho Clipping

Alan Harris alanosg at resoft.co.uk
Sat Sep 29 01:50:06 PDT 2007


Shane

In 1.2 I use the SceneView::setProjectionMatrixAsOrtho2D() function to 
control zoom (effectively field of view) and leave the eye location at a 
fixed distance from the scene.

Alan

Robert Osfield wrote:
> Hi Shane,
>
> Othographic views and zooming don't mix, one should never allow a user
> to zoom into scene in orthographic view.
>
> You can try and hack an orthographic view to kinda of behave like a
> perspective view but as soon as you enter the scene itself you end up
> with all manner of problems with near plan clipping where you don't
> expect it, or objects from behind you appear when they really
> shouldn't it.
>
> In the end you have to come to realise that expecting an orthographic
> view to be useful for interactive 3d views is very very limited to
> only views - its a fundamental aspect of orthographic view that is
> incompatible to free form user interactive.  Orthographic !=
> Perspective no matter how much you try and twist and contort it.
>
> Robert.
>
> On 9/28/07, Rogers, Shane <Shane_Rogers at mentor.com> wrote:
>   
>>
>> Hello,
>>
>> We are having some Ortho Clipping problems and I was wondering if anyone had
>> some insight on this. We are using and older version of OSG. Version 0.9.9,
>> we are using a camera and two types of lenses. Ortho and Perspective. You
>> can switch between the lenses and use either or.  The problem we are having
>> is, in Perspective you can zoom in on an object and look at it very closely
>> and inspect it and it does not disappear.  In the Ortho view when you try to
>> zoom in real close it disappears before you zoom in close enough to inspect
>> it.  I have noticed a couple of cases where I can zoom into something in
>> Ortho and have it not disappear, but in general it will disappear before I
>> get really close to it.
>>
>> This is how we are getting our lens's and switching between them.
>> float dist = m_KMCallback->getTrackBall()->getDistance();
>> switch( pt ) {
>> case Perspective:
>> m_camera->getLens()->convertToPerspective( dist );
>> m_projection = pt; break;
>> case Orthographic: m_camera->getLens()->convertToOrtho(
>> dist ); m_projection = pt; break;
>> }
>>
>> I have tried to set the Ortho lens clip near and far by using
>>
>> m_camera->getLens()->setOrtho(0,0,0,0,0,0);
>>
>> Where the last two values being passed to set Ortho are the near and far
>> clip.  I have also tried setting the Frustum and that did not work either.
>> I try to get the Frustum or get the Ortho so I can see what the values are
>> set to, but GetFrustum and GetOrtho are protected.  Any ideas on how I can
>> make the Ortho clipping better?
>>
>> Thanks,
>>
>> -Shane
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>>     
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>   



More information about the osg-users mailing list