[osg-users] Custom stats?
Hi, I'd like to display some custom stats every frame. For example, I have a custom drawable which I'd like to display some information about. What's the best way to go about doing this? Thanks, Brett ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Custom stats?
HI Brett, Just have a look how the present stats are done via the StatsHandler, it should tell you the various things that can be done to get things renderered and updated - there should be no need for custom drawables as it can all be done with standard OSG objects. Robert. On Thu, Mar 6, 2008 at 6:24 PM, Brett Wiesner <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to display some custom stats every frame. For example, I have a > custom drawable which I'd like to display some information about. What's > the best way to go about doing this? > > Thanks, > Brett > ___ > 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] Custom stats?
Robert, I already have a custom drawable; in fact that's what I want to view the stats of. For example, in the drawable is some openGL code which produces some billboards, and I want to know show how many billboards it's drawing. When I toggle the stats on and off, I'd like to see something like "Billboards: 2040" along with the framerate info etc. I've looked at the stats handler and traced the code around. Here's what it seems like I need to do... Please correct me if I'm wrong. 1. Add attributes to osg::Stats for the things I care about. (ie: "Billboards") 2. Derive from osg::statsHandler to get at those attributes and draw them. I'm a little confused here about the link between stats and statistics but it seems like I also need to... 3. Derive from osg::Statistics (BillBoardStatistics) and add members for things I care about ("ie: myNumBillboards"). 4. Add an "accept" method to my custom drawable class so that when the osg::statsvisitor visits I can get at my derived BillBoardStatistics class and update it with info about the number of billboards. Like I said, I'm confused about the connection between osg::stats and osg::statistics. Is there a connection? How does it work? Am I just way off here? Thanks, Brett Robert Osfield wrote: > HI Brett, > > Just have a look how the present stats are done via the StatsHandler, > it should tell you the various things that can be done to get things > renderered and updated - there should be no need for custom drawables > as it can all be done with standard OSG objects. > > Robert. > > On Thu, Mar 6, 2008 at 6:24 PM, Brett Wiesner <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I'd like to display some custom stats every frame. For example, I have a >> custom drawable which I'd like to display some information about. What's >> the best way to go about doing this? >> >> Thanks, >> Brett >> ___ >> 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
Re: [osg-users] Custom stats?
Hi Brett, Thanks for the further explanation, I know understand a bit more about what you are after. I'm afraid off the top of my head I can think of the specifics of what you'll need to do. You may well need to write you own traversal of the main view's RenderStage rather than relying upon the RenderBin::getStats(..) method. Robert. On Fri, Mar 7, 2008 at 1:57 PM, Brett Wiesner <[EMAIL PROTECTED]> wrote: > Robert, > > I already have a custom drawable; in fact that's what I want to view the > stats of. For example, in the drawable is some openGL code which > produces some billboards, and I want to know show how many billboards > it's drawing. When I toggle the stats on and off, I'd like to see > something like "Billboards: 2040" along with the framerate info etc. > > I've looked at the stats handler and traced the code around. Here's what > it seems like I need to do... Please correct me if I'm wrong. > > 1. Add attributes to osg::Stats for the things I care about. (ie: > "Billboards") > 2. Derive from osg::statsHandler to get at those attributes and draw them. > > I'm a little confused here about the link between stats and statistics > but it seems like I also need to... > > 3. Derive from osg::Statistics (BillBoardStatistics) and add members for > things I care about ("ie: myNumBillboards"). > 4. Add an "accept" method to my custom drawable class so that when the > osg::statsvisitor visits I can get at my derived BillBoardStatistics > class and update it with info about the number of billboards. > > Like I said, I'm confused about the connection between osg::stats and > osg::statistics. Is there a connection? How does it work? > > Am I just way off here? > > Thanks, > Brett > > > > Robert Osfield wrote: > > HI Brett, > > > > Just have a look how the present stats are done via the StatsHandler, > > it should tell you the various things that can be done to get things > > renderered and updated - there should be no need for custom drawables > > as it can all be done with standard OSG objects. > > > > Robert. > > > > On Thu, Mar 6, 2008 at 6:24 PM, Brett Wiesner <[EMAIL PROTECTED]> wrote: > > > >> Hi, > >> > >> I'd like to display some custom stats every frame. For example, I have a > >> custom drawable which I'd like to display some information about. What's > >> the best way to go about doing this? > >> > >> Thanks, > >> Brett > >> ___ > >> 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-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org