Some more comments. :)

When you count the triangles/vertices of a Switch, you consider only the
active child ! If you use the Switch with a mask, as in my case,
Switch.currentChild() returns null. So, you should check first
getWhichChild, and if it is negative, then it's either none, all or a mask !

Cheers,

Florin

-----Urspr�ngliche Nachricht-----
Von: Kevin Glass [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 4. Juni 2003 09:39
An: [EMAIL PROTECTED]
Betreff: Re: [JAVA3D] I am contributing code for counting triangles and
vertices


Ian,

Just observations, feel free to ignore

* Method comments are good, but would be nice if they were javadoc
compatible.

* How about some inline comments about the caculation for each type?

* Does this handle geometry coordinates by reference (Is this what the
Indexed versions do)?

* What if a background has no geometry? (what does get returned, null?)

* The list of group checks (instanceof BG, instanceof OG etc..) could just
be (instanceof Group)

* You could have made the code slightly simpler (or maybe less repetitive)
by utilising the "countVerticesInGeometry" method in the
"countTrianglesInGeometry" method.

Sorry if these comments seem too negative, not really intended that way.
More to the point, thanks for doing this. I've wanted to count the
triangles plenty of times, and its great that you took the time to do it.

Cheers,

Kev

> Hello All,
>
> I have seen in the past that some people have wanted to be able to count
> the number of polygons/triangles (and perhaps vertices) in a particular
> scene.  I have also wanted such functionality.
>
> So I have decided to implement a small set of simple utility methods to
> do just that, and contribute it to the list.
>
> I am attaching my code for review by the list.  If you see any problems
> please let me know and I will resolve them.  Hopefully j3d.org (and
> other websites) can roll this code into their existing utility packages.
>
> The code can:
> 1) count the number of triangles rooted at a particular node
> 2) count the number of triangles in a particular Geometry
> 3) count the number of vertices rooted at a particular node
> 4) count the number of vertices in a particular Geometry
>
> And the code is clean, understandable, and quite easily modifiable.
> Enjoy!
>
> Ian Nieves


--
Jose UML - http://www.newdawnsoftware.com/jose
Pondering RPG - http://pondering.newdawnsoftware.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

==========================================================================To 
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to