public void setup() {

    /* particles manager */
    _myParticleManager = new ParticleManager();

    /* create backup mesh */
    _myMesh =
        drawablefactory()
            .mesh(
                false,
                _myParticleManager.positionbackuparray,
                3,
                _myParticleManager.colorbackuparray,
                4,
                null,
                0,
                null,
                MESH_POINTS);

    /* create texture */
    _myPointSprites = new PointSprite();
    _myPointSprites.load(
        Bitmaps.getBitmap(Resource.getStream("demo/common/flower-particle.png"), "flower"));
    _myPointSprites.quadric = new float[] {0.001f, 0.000002f, 0.00001f};
    _myPointSprites.pointsize = 50;
    _myPointSprites.minpointsize = 10;
    _myPointSprites.maxpointsize = 250;

    _myMesh.material().addPlugin(_myPointSprites);
    _myMesh.material().depthtest = false;
    _myMesh.material().transparent = true;

    /* add to renderer */
    bin(BIN_3D).add(_myMesh);

    /* set framerate */
    framerate(UNDEFINED);
  }
Ejemplo n.º 2
0
  private void createTextPlanes() {
    FontProducer _myFontProducer =
        Bitmaps.getFontProducer(
            Resource.getStream("resource/data/demo/font/silkscreen/slkscr.ttf"));
    _myFontProducer.setSize(32);
    _myFontProducer.setQuality(Gestalt.FONT_QUALITY_HIGH);

    _myFontPlane = new Plane[10];
    _myFontTexture = new TexturePlugin[_myFontPlane.length];
    for (int i = 0; i < _myFontPlane.length; ++i) {
      System.out.println("### INFO / creating texture " + (i + 1) + "/" + _myFontPlane.length);

      _myFontTexture[i] = drawablefactory().texture();
      _myFontTexture[i].load(_myFontProducer.getBitmap("***** " + i + " *****"));

      _myFontPlane[i] = drawablefactory().plane();
      _myFontPlane[i].material().color4f().set((float) i / (float) _myFontPlane.length);
      _myFontPlane[i].material().depthtest = false;
      _myFontPlane[i].material().addPlugin(_myFontTexture[i]);
      _myFontPlane[i].setPlaneSizeToTextureSize();
      _myFontPlane[i].transform().translation.z = i * -10;
      bin(BIN_3D).add(_myFontPlane[i]);
    }
  }