Re: [osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Robert Osfield
On Fri, Apr 24, 2009 at 2:42 PM, Gianluca Natale
 wrote:
> Robert,
> is there a quick way to simply update near and far clipping planes for
> perspective
> projection, without calling an explicitly redraw (I mean, some visitor that
> computes for example the bounding box of the model and updates near and far
> clipping plane also)?

There is no quick way, you'll need to do this by hand.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Gianluca Natale
Robert,
is there a quick way to simply update near and far clipping planes for
perspective
projection, without calling an explicitly redraw (I mean, some visitor that
computes for example the bounding box of the model and updates near and far
clipping plane also)?

Thanks,
Gianluca


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Gianluca
Natale
Sent: venerdì 24 aprile 2009 12.29
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] update of zNear and zFar during drawing

Thank you again, Robert.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: venerdì 24 aprile 2009 11.54
To: OpenSceneGraph Users
Subject: Re: [osg-users] update of zNear and zFar during drawing

On Fri, Apr 24, 2009 at 10:39 AM, Gianluca Natale
 wrote:
> Thank you Robert,
> I apologize for my ignorance.
> Actually I don't want to make any zoom in, I just want to
> clip objects behind the camera (is there any problem in
> clipping a sphere against a rectangular box?)

You can do what you want with the near + far clipping planes in
orthographic and perspetive projections simply by switch off the
automatic compute of the near and planes via

   camera->setComputeNearFar(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

But this won't make othrographic magically appropriate for doing internal
views.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.238 / Virus Database: 270.12.4/2077 - Release Date: 04/23/09
19:21:00

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.238 / Virus Database: 270.12.4/2077 - Release Date: 04/23/09
19:21:00

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Gianluca Natale
Thank you again, Robert.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: venerdì 24 aprile 2009 11.54
To: OpenSceneGraph Users
Subject: Re: [osg-users] update of zNear and zFar during drawing

On Fri, Apr 24, 2009 at 10:39 AM, Gianluca Natale
 wrote:
> Thank you Robert,
> I apologize for my ignorance.
> Actually I don't want to make any zoom in, I just want to
> clip objects behind the camera (is there any problem in
> clipping a sphere against a rectangular box?)

You can do what you want with the near + far clipping planes in
orthographic and perspetive projections simply by switch off the
automatic compute of the near and planes via

   camera->setComputeNearFar(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

But this won't make othrographic magically appropriate for doing internal
views.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.238 / Virus Database: 270.12.4/2077 - Release Date: 04/23/09
19:21:00

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Robert Osfield
On Fri, Apr 24, 2009 at 10:39 AM, Gianluca Natale
 wrote:
> Thank you Robert,
> I apologize for my ignorance.
> Actually I don't want to make any zoom in, I just want to
> clip objects behind the camera (is there any problem in
> clipping a sphere against a rectangular box?)

You can do what you want with the near + far clipping planes in
orthographic and perspetive projections simply by switch off the
automatic compute of the near and planes via

   camera->setComputeNearFar(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

But this won't make othrographic magically appropriate for doing internal views.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Gianluca Natale
Thank you Robert,
I apologize for my ignorance.
Actually I don't want to make any zoom in, I just want to
clip objects behind the camera (is there any problem in
clipping a sphere against a rectangular box?)

Thanks,
Gianluca


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: venerdì 24 aprile 2009 11.02
To: OpenSceneGraph Users
Subject: Re: [osg-users] update of zNear and zFar during drawing

HI Gianluca,

Arggghhg... You can't use orthographic projects in the same way that
you use perspective projections, it simply doesn't work.

Use orthographic projections for external views of the scene where
clipping is not used.  Do *not* use it for internal views where
clipping is critical.  Try to do this on and you'll just waste lots of
your time and lots of the communities time trying to explain to you
why it won't work.

Robert.

On Fri, Apr 24, 2009 at 9:44 AM, Gianluca Natale
 wrote:
> Hi all.
> I have a strange behavior when I let OSG update the near and far clipping
> planes during drawing.
> When I use a perspective projection, and I move the camera inside the
model
> (I mean, inside the global
>
> bounding sphere of the model), the near clipping plane is placed very near
> to the camera, so to clip
>
> as few objects as possible. I like this behavior, and I would like to use
it
> also for Orthogonal projections.
> But in that case, when I move the camera into the model, the near clipping
> plane becomes negative,
> so the viewing volume includes always the whole model. And I don’t like
this
> now.
>
> Is this the right behavior, or did I miss something/make some mistake?
> If this is the way it works for orthogonal projections, is there a way to
> make it work like perspective one?
>
>
>
> Thanks in advance.
>
> Gianluca Natale
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.238 / Virus Database: 270.12.4/2077 - Release Date: 04/23/09
19:21:00

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Robert Osfield
HI Gianluca,

Arggghhg... You can't use orthographic projects in the same way that
you use perspective projections, it simply doesn't work.

Use orthographic projections for external views of the scene where
clipping is not used.  Do *not* use it for internal views where
clipping is critical.  Try to do this on and you'll just waste lots of
your time and lots of the communities time trying to explain to you
why it won't work.

Robert.

On Fri, Apr 24, 2009 at 9:44 AM, Gianluca Natale
 wrote:
> Hi all.
> I have a strange behavior when I let OSG update the near and far clipping
> planes during drawing.
> When I use a perspective projection, and I move the camera inside the model
> (I mean, inside the global
>
> bounding sphere of the model), the near clipping plane is placed very near
> to the camera, so to clip
>
> as few objects as possible. I like this behavior, and I would like to use it
> also for Orthogonal projections.
> But in that case, when I move the camera into the model, the near clipping
> plane becomes negative,
> so the viewing volume includes always the whole model. And I don’t like this
> now.
>
> Is this the right behavior, or did I miss something/make some mistake?
> If this is the way it works for orthogonal projections, is there a way to
> make it work like perspective one?
>
>
>
> Thanks in advance.
>
> Gianluca Natale
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] update of zNear and zFar during drawing

2009-04-24 Thread Gianluca Natale
Hi all.
I have a strange behavior when I let OSG update the near and far clipping
planes during drawing.
When I use a perspective projection, and I move the camera inside the model
(I mean, inside the global

bounding sphere of the model), the near clipping plane is placed very near
to the camera, so to clip

as few objects as possible. I like this behavior, and I would like to use it
also for Orthogonal projections.
But in that case, when I move the camera into the model, the near clipping
plane becomes negative,
so the viewing volume includes always the whole model. And I don't like this
now.

Is this the right behavior, or did I miss something/make some mistake?
If this is the way it works for orthogonal projections, is there a way to
make it work like perspective one?

 

Thanks in advance.

Gianluca Natale

 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org