Example #1
0
  static {
    // static initializer that creates a mesh blueprint and loads the
    // textures.
    try {
      SimpleStream ss = new SimpleStream("data/weapon.jpg");
      TextureManager.getInstance().addTexture("weapon", new Texture(ss.getStream()));
      ss.close();

      ss = new SimpleStream("data/snork.md2");
      bluePrint = new ClientObject(Loader.loadMD2(ss.getStream(), 0.22f)); // 0.32f
      bluePrint.translate(0, 4.5f, 0);
      bluePrint.translateMesh();
      bluePrint.getTranslationMatrix().setIdentity();
      bluePrint.translate(100000, 100000, 100000);

      sphereBluePrint = Primitives.getSphere(9, 6);
      sphereBluePrint.build();
      sphereBluePrint.setTexture("shield");

      sphereBluePrint.calcTextureWrapSpherical();

      ss.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }