WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Counting all objects in view (https://forum.worldviz.com/showthread.php?t=4961)

chris2307 02-24-2014 04:56 AM

Counting all objects in view
 
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.


All times are GMT -7. The time now is 06:04 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC