コード例 #1
0
  public void draw() {

    GL2 gl = getGL2();

    pushMatrix();

    translate(0, 0, -2);
    rotate(view_rotx, 1.0, 0.0, 0.0);
    rotate(view_roty, 0.0, 1.0, 0.0);
    rotate(view_rotz, 0.0, 0.0, 1.0);
    translate(0, 0, 2);

    if (app != null) {
      if (is_playing) {
        map_previous = map;
        map =
            new DepthMap(
                app.w,
                app.h,
                DepthMap.fromRawDepthFile(
                    new File(app.filename), app.frame_now - 1, app.w, app.h, false));
        map.maskZ(app.z_threshold.getValue() / 100f);
        // map.maskRect(130,40,100,100);//head
        // map.maskRect(50,140,130,100);//arms
        map.setUVuniform();
        if (app.frame_now < app.frames) {
          app.frame_now += 1;
          app.time_domain.setValue(app.frame_now);
        } else {
          app.play_button.setText("Play");
          stop();
        }
      }
    }

    if (map != null) {
      if (app.show_diff.isSelected() && map != null && map_previous != null) {

        // map.drawNormals(gl);

        // gl.glClear(GL2.GL_DEPTH);
        // gl.glEnable(GL2.GL_BLEND);

        computeColorMap();
        gl.glDisable(GL2.GL_LIGHTING);
        gl.glEnable(GL2.GL_TEXTURE_2D);
        gl.glColor4f(1f, 1f, 1f, 0.75f);
        video_frame.use(gl);
        map.drawTextureNormals(gl);
        gl.glDisable(GL2.GL_TEXTURE_2D);
        gl.glEnable(GL2.GL_LIGHTING);
        gl.glDisable(GL2.GL_BLEND);
      } else {
        gl.glColor3f(0.9f, 0.9f, 0.9f);
        map.drawNormals(gl);
      }
    }

    popMatrix();
  }
コード例 #2
0
  public void update(RAWViewerApp app) {
    if (!is_playing && app.filename.length() > 0) {
      this.app = app;

      if (app.frame_now > 1) {
        map_previous =
            new DepthMap(
                app.w,
                app.h,
                DepthMap.fromRawDepthFile(
                    new File(app.filename), app.frame_now - 2, app.w, app.h, false));
        map_previous.maskZ(app.z_threshold.getValue() / 100f);
        map_previous.setUVuniform();
      }
      map =
          new DepthMap(
              app.w,
              app.h,
              DepthMap.fromRawDepthFile(
                  new File(app.filename), app.frame_now - 1, app.w, app.h, false));
      map.maskZ(app.z_threshold.getValue() / 100f);
      map.setUVuniform();
    }
  }