Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How can I get the viewer's camera to 'ignore' a node's geometry?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sergey Polischuk  
View profile  
 More options Oct 5 2012, 4:07 pm
From: Sergey Polischuk <pol...@yandex.ru>
Date: Sat, 06 Oct 2012 00:07:28 +0400
Local: Fri, Oct 5 2012 4:07 pm
Subject: Re: [osg-users] How can I get the viewer's camera to 'ignore' a node's geometry?

Hi
 
I'm talking about setting this bounds callbacks on geometry(drawable) leaves.
 
05.10.2012, 17:20, "Glenn Waldron" <gwaldron@gmail.com>:
Is that true? Setting an invalid bounding sphere will indeed suppress node-level culling, but I believe the near/far calculation is done at the Drawable level. See CullVisitor::apply(Geode&). 
The usual approach for terrain rendering is to subdivide your globe into tiles. Then OSG can cull out the tiles that are not in the view, including far-off tiles or back-facing tiles (by means of the ClusterCullingCallback). That will bring the far clip plane closer and give you the z-buffer resolution you need in order to visualize surface features. 
In addition, you can decrease the Camera's near/far ratio; this will give you a little more near clip space if you still need it.

Glenn Waldron / @glennwaldron


On Fri, Oct 5, 2012 at 7:28 AM, Sergey Polischuk <pol-ss@yandex.ru> wrote:
Hi

You can set ComputeBoundingBoxCallback on a geometry to specify whatever bounds you want. In your case to ignore earth geometry bound you can set its bound to uninitialized bounding box, and it will not make any difference to near\far calculations. Note that this thing completely disable view frustum culling on a geometry! In order to get it working you should write your cull callback and do check vs actual bounds there, if you need it.

Code looks like:

class UseInitialBoundsCallback : public osg::Drawable::ComputeBoundingBoxCallback
{
public:
        osg::BoundingBox computeBound (const osg::Drawable & drawable)
        {
                osg::BoundingBox brand_new_uninitialized_bbox;
                return brand_new_uninitialized_bbox;
        }
};

geometry->setComputeBoundingBoxCallback(new UseInitialBoundsCallback);

Cheers, Sergey.

05.10.2012, 05:11, "Preet" <prismatic.project@gmail.com>:
> On Thu, Oct 4, 2012 at 5:37 PM, Chris Hanson <xenon@alphapixel.com> wrote:
>
>>  I wanted to avoid specifying the near/far planes manually since the
>>>  behaviour without the Earth surface geometry is perfect as is. I don't
>>>  care about the overhead of drawing the surface geometry since its so
>>>  simple, and I don't want the scene graph to account for the surface
>>>  geometry (outside of rendering it); the other objects in the scene
>>>  should determine the camera frustum.
>>    Due to the way OGL works with near/far, if you want it drawn, you need it
>>  taken into account when computing the near/far planes.
>>
>>    Are you just worried about the far plane being set too far?
>>>  Including geometry for the
>>  Earth's surface makes the other stuff disappear (and reappear at
>>  certain angles).
>>
>>    It sounds to me like you're not trying to solve the right problem. You
>>  should first determine WHY these other items aren't displayed at times.
>
> Sorry if it wasn't clear; the items aren't being displayed because the
> near and far planes that osg sets creates a frustum that doesn't
> include them. I need to manually set the near and far planes to see
> everything.
>
> The near and far planes that osg sets without the earth surface
> geometry is fine. Once you add the surface geometry though, the near
> and far planes are set such that the items are no long in the view
> frustum.
>
> I was looking for a flag or something that basically tells osg "hey,
> don't include this node when you do your view frustum calculations"
> _______________________________________________
> 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.