I'm using code from Arch.java (written by David R. Nadeau @ San Diego
Supercomputer Center) to generate a few thousand spheres for my project.  I
use the Arch code (below) to return a geometry for a sphere, then pack lots
of those geometries inside one Shape3D.  It really uses a lot of memory to
make all those QuadArrays, and I'm wondering if there's a more
memory-efficient way of doing it.

I don't think using a primitive sphere and transforming it would help,
because I'd have a few thousand Shape3Ds, and their associated transforms,
and that would probably be a real memory hog.

Anybody have an idea on how to decrease my memory useage?

...
        IndexedQuadArray polys = new IndexedQuadArray(vertexCount,

GeometryArray.COORDINATES,
                                                     indexCount );
        //
        //  Compute coordinates
        //
        theta = startTheta;
        tex[0] = 0.0f;
        int index = 0;
        for ( int i = 0; i < nTheta; i++ ) {
            phi = startPhi;
            radius = startPhiRadius;
            thickness = startPhiThickness;
            tex[1] = 0.0f;

            for ( int j = 0; j < nPhi; j++ ) {
                xyz[0] = radius * norm[0] + centerpoint.x;
                xyz[1] = radius * norm[1] + centerpoint.y;
                xyz[2] = radius * norm[2] + centerpoint.z;
                polys.setCoordinate( index, xyz );

...
        polys.setCoordinateIndices( 0, indices );

...


Daniel Dvorak

===========================================================================
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