PDA

View Full Version : Counting all objects in view


chris2307
02-24-2014, 04:56 AM
I was hoping that there may be a way to efficiently work out the total number of objects (sub-objects within a scene) that are in view.

The current way I would implement it (which I have not done yet) would be to use the viz.pick() command in order to return the object intersected with at every point on the screen. There would also have to be some logic in place to work out if the object returned has already been returned once and if not, add it to the counter of current visible objects in view.

Does anybody have any more elegant solutions for how I could do this as my method seems a bit brute force like. :cool:

Jeff
02-28-2014, 06:19 AM
You could loop through a list of object names and use window.isCulled to find out which are in the view frustum. The command has a name argument to check the status of sub-children.

chris2307
03-01-2014, 11:14 AM
This is much better than my method so thanks!

Just for clarification, I popped this post in this section as I am using the Vizard 5 Beta right now. Hope this was right.