Exemple #1
0
  public void rendering(GL2GL3 gl) {
    updateCanvasSize(gl);
    currentSO.rendering(gl);
    currentSO.iterate(gl);
    if (switched) {
      scene.shader1f(gl, gamma, "gamma");
      scene.shader1f(gl, heightscale, "heightscale");
      scene.shadowmapshader1f(gl, heightscale, "heightscale");

      switched = false;
    }
    // screenshot("SS/ipsj2/", 1024, 1024);
  }
Exemple #2
0
 public void keyPressed(KeyEvent e) {
   currentSO.keyPressed(e);
   switch (e.getKeyChar()) {
     case 's':
       if (shadowswitch == 0) {
         shadowswitch = 1;
       } else {
         shadowswitch = 0;
       }
       switched = true;
       break;
     case 'h':
       if (heightctrl) {
         heightctrl = false;
       } else {
         heightctrl = true;
       }
       break;
     case 'p':
       gamma += 0.1;
       System.out.println(gamma);
       switched = true;
       break;
     case 'o':
       gamma -= 0.1;
       System.out.println(gamma);
       switched = true;
       break;
   }
 }
Exemple #3
0
 private void updateCanvasSize(GL2GL3 gl) {
   if (CANVAS_WIDTH_prev != CANVAS_WIDTH || CANVAS_HEIGHT_prev != CANVAS_HEIGHT) {
     currentSO.setCanvasSize(gl, CANVAS_WIDTH, CANVAS_HEIGHT);
     CANVAS_WIDTH_prev = CANVAS_WIDTH;
     CANVAS_HEIGHT_prev = CANVAS_HEIGHT;
   }
 }
Exemple #4
0
 public void actionPerformed(ActionEvent e) {
   currentSO.actionPerformed(e);
 }
Exemple #5
0
 public void mouseMoved(MouseEvent e) {
   if (currentSO == null) {
     return;
   }
   currentSO.mouseMoved(e);
 }
Exemple #6
0
 public void mouseReleased(MouseEvent e) {
   if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) rightclicking = false;
   currentSO.mouseReleased(e);
 }
Exemple #7
0
 public void mousePressed(MouseEvent e) {
   if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) rightclicking = true;
   currentSO.mousePressed(e);
 }
Exemple #8
0
 public void mouseDragged(MouseEvent e) {
   currentSO.mouseDragged(e);
 }