Exemplo n.º 1
0
  protected void simpleUpdate() {

    if (timer.getTimePerFrame() < 1) {
      angle = angle + (timer.getTimePerFrame() * 25);
      if (angle > 360) {
        angle = 0;
      }
    }

    rotQuat.fromAngleAxis(angle * FastMath.DEG_TO_RAD, axis);
    s.setLocalRotation(rotQuat);
  }
Exemplo n.º 2
0
  /**
   * builds the trimesh.
   *
   * @see com.jme.app.SimpleGame#initGame()
   */
  protected void simpleInitGame() {
    display.setTitle("Octahedron Test");
    cam.setLocation(new Vector3f(0, 0, 100));
    cam.update();

    s = new Octahedron("Octahedron", 20);
    s.setModelBound(new BoundingBox());
    s.updateModelBound();

    rootNode.attachChild(s);

    TextureState ts = display.getRenderer().createTextureState();
    ts.setEnabled(true);
    ts.setTexture(
        TextureManager.loadTexture(
            TestBoxColor.class.getClassLoader().getResource("jmetest/data/images/Monkey.jpg"),
            Texture.MinificationFilter.BilinearNearestMipMap,
            Texture.MagnificationFilter.Bilinear));

    // rootNode.setRenderState(ts);

  }