Ejemplo n.º 1
0
  private void addGeometry(
      GLRenderer renderer,
      Geometry geometry,
      Color color,
      double x,
      double y,
      double z,
      double rx,
      double ry,
      double rz,
      double s) {
    // 3d shape
    List<Material> materials = new ArrayList<Material>();
    materials.add(new MeshLambertMaterial().setColor(color).setOpacity(0.2).setTransparent(true));
    materials.add(new MeshBasicMaterial().setColor(0x000000).setWireframe(true).setOpacity(0.3));
    Object3D mesh = SceneUtils.createMultiMaterialObject(geometry, materials);

    mesh.getPosition().set(x, y, z - 75.0);

    mesh.getScale().set(s);

    //			if (geometry.debug)
    //				mesh.add(geometry.debug);

    this.parentObject.add(mesh);
    renderer.render(scene, camera);
  }
  @Override
  public void setAnimation(Animation animation) {
    this.listener = animation;
    // tell listener about app creation
    try {
      renderer.setDefaultGLState();

      if (listener instanceof InputHandler) input.setInputHandler((InputHandler) listener);
      listener.onStart(this);
      listener.onResize(this);

      for (AnimationReadyListener ready : animationReadyListener) ready.onAnimationReady(listener);

    } catch (Throwable t) {
      Log.error("GwtRendering: exception: " + t.getMessage(), t);
      t.printStackTrace();
      throw new ParallaxRuntimeException(t);
    }

    run();
  }
 private void fullscreenChanged() {
   if (!isFullscreen()) {
     renderer.setSize(lastWidth, lastHeight);
   }
 }