Esempio n. 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);
  }
Esempio n. 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;
   }
 }
Esempio n. 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;
   }
 }
Esempio n. 4
0
 public void actionPerformed(ActionEvent e) {
   currentSO.actionPerformed(e);
 }
Esempio n. 5
0
 public void mouseMoved(MouseEvent e) {
   if (currentSO == null) {
     return;
   }
   currentSO.mouseMoved(e);
 }
Esempio n. 6
0
 public void mouseReleased(MouseEvent e) {
   if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) rightclicking = false;
   currentSO.mouseReleased(e);
 }
Esempio n. 7
0
 public void mousePressed(MouseEvent e) {
   if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) rightclicking = true;
   currentSO.mousePressed(e);
 }
Esempio n. 8
0
 public void mouseDragged(MouseEvent e) {
   currentSO.mouseDragged(e);
 }