[osg-users] ...framing only visible objects

Frank Bergmann fbergman at kgi.edu
Tue Jul 31 10:08:45 PDT 2007


Hello Allessandro,

you could try the following,

- load all object into a boundingbox of the same size, centered at  
the origin
- during load you assign a different node mask to each element,
- use the default camera

- now whenever you want to look at a different object, you just set  
the nodemask ... which will result in only that object being visible

best
frank


On Jul 31, 2007, at 9:59 AM, alessandro terenzi wrote:

> Thanks.
>
> ...my problem is that if the scene consists of many objects, and  
> some of them are hidden, the default camera is set to look to  
> everything anyway, I mean that the camera looks at the whole scene  
> comprising hidden objects too.
>
> ...instead, I'd like to re-adjust the camera not only from the  
> position point of view (actually, it is ok to look at the origin),  
> but also with respect to other parameters in order to adjust the  
> view only on visible objects ...in particular, my application is a  
> kind of presentation of 3d objects, so just one object per time is  
> visible and is positioned in the origin, so actually I don't need  
> to look elsewhere, but I just need to adjust the camera's 'zoom' in  
> order to frame just the currently visible object... can you suggest  
> a way to achive this adjustment?... which parameters should I modify?
>
> ...by the way, each object has its own size that can differs a lot  
> with other objects, that is the problem with the default camera  
> settings, because it zoomes out to view everything...
>
> Thanks. Best regards.
> Alessandro
>
> On 7/31/07, Peter Gebauer <peter.gebauer at stockholm.bostream.se> wrote:
> Hello!
>
> The "spacebar event" is simply setting the camera to the camera
> manipulator's home position. It does not modify your scenegraph,  
> although it
> might appear that way. The home position is either calculated  
> (default) or
> set using an eye and center coordinate along with the definition of  
> up.
>
> See osgGA::MatrixManipulator and osgViewer::Viewer for more info.
>
> /Peter
>
> On 2007-07-31 (Tue) 17:08, alessandro terenzi wrote:
> > Hello,
> > using osgViewer, I see that pressing the spacebar the view is  
> restored in
> > order tor frame all the objects in the scene... I also noticed  
> that it
> > adjusts the camera in order to consider also objects that are not  
> visible...
> > how can I change this behaviour in order to frame just visible  
> objects?
> > Where can I have a look in osg code to understand how the  
> 'spacebar' event
> > is handled?
> >
> > Thank you. Best regards.
> > Alessandro
>
> > _______________________________________________
> > 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
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users- 
> openscenegraph.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070731/51a4a393/attachment.html 


More information about the osg-users mailing list