Let's get some more numbers: SceneGraph displays 27000 spheres.
Approach 1: 27000 TG + 27000 Shapes + 1 Appearance + 1 Geometry, uses aprox 140 MB. That means roughly 5k per TG+Shape combination, and a grand total of 54000 objects to be eventually garbage collected Approach 2: 900 TG + 900 Shapes + 1 Appearance + 30 geometries, uses aprox 15 MB, and makes a grand total of 1830 objects. In both cases, one Sphere uses aprox. 400 vertices and normals (no texture) - 9.6 kb We have made an economy of (26100 tg+shapes) * 5k = 130MB and only used for the extra 30 geometry 288 kb With a quick calculus, it's easy to observe that <b>for that specific problem, i.e. 27000 spheres</b>, the optimum memory usage is obtained with 250 TG+S and 108 geometries per shape, leading to a total memory usage of aprox 2.5 MB with only 610 objects !!! So, in a scenegraph containing only homogeneous spheres, the optimum is : TG = sqrt(2 * n-spheres), Geom-per-shape = n-spheres/TG Cheers, Florin -----Ursprüngliche Nachricht----- Von: N. Vaidya [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 26. Februar 2003 16:20 An: [EMAIL PROTECTED] Betreff: Re: [JAVA3D] AW: [JAVA3D] AW: [JAVA3D] Java 3D or GL4Java (also solution to la rge number of geometry problem) Hi Ian and Florin, This problem of when and when not to use TGs was examined by Chien and and to some extent by me sometime last year IIRC. I think it is a compromise and mostly app. specific. Chien gave the useful stat. that TG + Shape3D takes ~3.6K (off the top of my head). http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0204&L=java3d-interest&P=R76 84&D=1&O=D&m=29246 http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0204&L=java3d-interest&P=R15 076&D=1&H=0&O=D&T=1&m=29246 Rgds Raj Vaidya ==========================================================================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".