Пример #1
0
  /**
   * builds the trimesh.
   *
   * @see com.jme.app.SimpleGame#initGame()
   */
  protected void simpleInitGame() {
    display.setTitle("Cylinder Test");

    t = new Tube("Tube", 18, 12, 30);
    t.getLocalTranslation().z = -30;
    t.setModelBound(new BoundingSphere());
    t.updateModelBound();
    rootNode.attachChild(t);

    TextureState ts = display.getRenderer().createTextureState();
    ts.setEnabled(true);
    ts.setTexture(
        TextureManager.loadTexture(
            TestTube.class.getClassLoader().getResource("jmetest/data/images/Monkey.jpg"),
            MinificationFilter.Trilinear,
            MagnificationFilter.Bilinear));
    ts.getTexture().setWrap(WrapMode.Repeat);
    rootNode.setRenderState(ts);
  }
Пример #2
0
  protected void simpleUpdate() {
    if (timer.getTimePerFrame() < 1) {
      angle = angle + (timer.getTimePerFrame() * 1);
      if (angle > 360) {
        angle = 0;
      }
    }

    rotQuat.fromAngleNormalAxis(angle, axis);
    t.setLocalRotation(rotQuat);
  }