google-code-export / papervision3d

Automatically exported from code.google.com/p/papervision3d
1 stars 1 forks source link

StatsView.countPolys() sometimes innacurate #151

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I don't know, it happens with some scenes and not others.

What is the expected output? What do you see instead?
Expected is number of poly's what I see is an exponentially larger number.

What version of the product are you using? On what operating system?
rev 847. WinXP. FlashDevelop. Pure As3 Project.

Please provide any additional information below.
Here is a solution (it leaves in a useless variable from the original):

        public static function countPolys(obj:DisplayObject3D):Number
        {
            var polygonCount:Number = 0;
            polygonCount = recurseDisplayObject(obj, polygonCount);
            return polygonCount;
        }

        private static function recurseDisplayObject(obj:DisplayObject3D,
polygonCount:Number):Number {
            for each (var childObj:DisplayObject3D in obj.children)
            {
                FlashConnect.trace("o: " + childObj);
                polygonCount += recurseDisplayObject(childObj, polygonCount);
            }

            if( obj.geometry && obj.geometry.faces ) for( var i:int=0;
i<obj.geometry.faces.length; i++) polygonCount++;

            return polygonCount;
        }

Original issue reported on code.google.com by gilbuns@gmail.com on 17 Dec 2008 at 5:36

GoogleCodeExporter commented 9 years ago
I'll take a look

Original comment by neori...@gmail.com on 29 Dec 2008 at 4:59

GoogleCodeExporter commented 9 years ago
I've compared the code you provided, and it' matches up with the current methods
identically, with the exception of the one trace statement.

Original comment by neori...@gmail.com on 8 Mar 2009 at 7:00