Re: [osg-users] placing image on scene
Hi Bryan, On Thu, Apr 17, 2008 at 1:54 AM, Bryan Berg [EMAIL PROTECTED] wrote: Can I clarify than if a cull callback gets called for a node, that means the node will be visible ? It simply means that node where the cull callback has been attached hasn't been culled yet, so its a potential candidate for being visible. Its children might be culled though. Only if the whole bounding sphere of the node is the view frustum can you say for certain that the some part of the subgraph will be visible, even then potentially LOD'ing code cull parts of the subgraph. Would than the boolean node.getCullingActive; tell you if a cull callback has been called ? No, this is just a flag to tell the cull traversal whether that node should have any cull testing applied to it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] placing image on scene
Hi, So I figured out how to add an image on a specific location of the screen, and keep it at the same size like a placemark. So even if the user zooms in and out of the scene, the image remains the same size. But I need a way to only show it when a specific point of the scene is visible. So my question is: how can I take a specific point of the scene and than a)determine if it is to be viewed b)if so, which window coordinate it corresponds to Thanks ! -Bryan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] placing image on scene
On Wed, Apr 16, 2008 at 5:42 PM, Bryan Berg [EMAIL PROTECTED] wrote: So my question is: how can I take a specific point of the scene and than a)determine if it is to be viewed A cull callback only gets called if the node hasn't yet been culled so its one way of determining visibility. Its not 100% accurate as bounding volumes are larger than the model they enclose so its overly conservative. The only 100% reliable way is to render the objects and use the OpenGL occlusion query extension to find out how many pixels are visible. b)if so, which window coordinate it corresponds to From within a cull callback you get get the accumulated modelview, projection and window matrices that you can use to project the local object coords into window coords. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] placing image on scene
Wait so let me guess... Osgcallback contains an example of this... : ) Thanks Robert! -Bryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Wednesday, April 16, 2008 10:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] placing image on scene On Wed, Apr 16, 2008 at 5:42 PM, Bryan Berg [EMAIL PROTECTED] wrote: So my question is: how can I take a specific point of the scene and than a)determine if it is to be viewed A cull callback only gets called if the node hasn't yet been culled so its one way of determining visibility. Its not 100% accurate as bounding volumes are larger than the model they enclose so its overly conservative. The only 100% reliable way is to render the objects and use the OpenGL occlusion query extension to find out how many pixels are visible. b)if so, which window coordinate it corresponds to From within a cull callback you get get the accumulated modelview, projection and window matrices that you can use to project the local object coords into window coords. Robert. ___ 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
Re: [osg-users] placing image on scene
Can I clarify than if a cull callback gets called for a node, that means the node will be visible ? Would than the boolean node.getCullingActive; tell you if a cull callback has been called ? If so do I have to initialize a cull callback for a node I'm trying to watch (cause I would think culling is done automatically) Thanks! -Bryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Wednesday, April 16, 2008 10:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] placing image on scene On Wed, Apr 16, 2008 at 5:42 PM, Bryan Berg [EMAIL PROTECTED] wrote: So my question is: how can I take a specific point of the scene and than a)determine if it is to be viewed A cull callback only gets called if the node hasn't yet been culled so its one way of determining visibility. Its not 100% accurate as bounding volumes are larger than the model they enclose so its overly conservative. The only 100% reliable way is to render the objects and use the OpenGL occlusion query extension to find out how many pixels are visible. b)if so, which window coordinate it corresponds to From within a cull callback you get get the accumulated modelview, projection and window matrices that you can use to project the local object coords into window coords. Robert. ___ 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