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