Doug Gehringer wrote:
>
> Billboards are one way to render "fuzzy particles" but there are two
> alternatives which should be faster:
>
>         1) Large, anti-aliased points.  These should be the fastest, but
>            there may be problems with inconsistent rendering on different
>            OpenGL implementations


Here is a test-function I wrote that generates a number of transparent
antialiased points. I am running a STB V4400 graphic card (based on
NVidia Riva TNT) in a PII 400MHz, WinNT4.0, JAVA1.3beta and Java3D
1.2beta, and rendering 10 000 particles seems to run OK.

How many particles are needed to make a cloud?

Dag Magne



Shape3D GenerateParticles(int noOfParticles, int particleSize, float
transparency,  float cubesize)
      {
        Randomizer rand = new Randomizer();

        Point3f[] pointCoords = new Point3f[noOfParticles];

        for(int i=0;i<noOfParticles;i++)
        {
          float posx = -cubesize/2 + cubesize*rand.nextFloat(0.0f,
1.0f);
          float posy = -cubesize/2 + cubesize*rand.nextFloat(0.0f,
1.0f);
          float posz = -cubesize/2 + cubesize*rand.nextFloat(0.0f,
1.0f);
          pointCoords[i] = new Point3f( posx, posy, posz);
        }

        PointArray pointArray = new PointArray( pointCoords.length,
GeometryArray.COORDINATES );
        pointArray.setCoordinates( 0, pointCoords );

        PointAttributes pointAttributes = new PointAttributes();
        pointAttributes.setPointSize(particleSize);
        pointAttributes.setPointAntialiasingEnable(true);

        TransparencyAttributes pointTransparency = new
TransparencyAttributes();

pointTransparency.setTransparencyMode(TransparencyAttributes.BLENDED);
        pointTransparency.setTransparency(transparency);

        ColoringAttributes pointColor = new ColoringAttributes();
        pointColor.setColor(0.0f, 1.0f, 0.0f);

        Appearance pointAppearance = new Appearance();
        pointAppearance.setPointAttributes(pointAttributes);
        pointAppearance.setTransparencyAttributes(pointTransparency);
        pointAppearance.setColoringAttributes(pointColor);

        return new Shape3D( pointArray, pointAppearance );

      }

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