Examples of SceneNode


Examples of stephencarmody.k8.core.SceneNode

   
    // Get screen limits
    layer = new Layer(depth);
   
    // Root SceneNode, translated -width/2, -height/2
    scenenode = new SceneNode();
    scenenode.moveRight(-layer.getWidth()/2);
    scenenode.moveUp(-layer.getHeight()/2);
    camera.appendChild(scenenode);
    scenenode.moveForward(depth);
   
View Full Code Here

Examples of syn3d.nodes.SceneNode

  }
 
  public void mouseDragged(MouseEvent e) {
    if (!handleMouseDragged) return;
   
    SceneNode scene = (SceneNode)e.getSource();
   
      if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) {
        scene.rotate2D(e.getX(), e.getY());
    }

    if ((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK) {
      scene.translate2D(e.getX(), e.getY());
    }
   
    if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
      scene.zoom2D(e.getX(), e.getY());
    }
  }
View Full Code Here

Examples of syn3d.nodes.SceneNode

    }
   
  public void keyTyped(KeyEvent e) {
    if (!handleKeyTyped) return;

    SceneNode scene = (SceneNode)e.getSource();
   
    if ((e.getKeyChar() == 'p') || (e.getKeyChar() == 'P')) {
      // Change the projection policy
      scene.changeProjection();
    } else if (( e.getKeyChar() == 'r') || (e.getKeyChar() == 'R')){
      scene.reset();
    } else if ( e.getKeyChar() == '\n') {
      // enter for auto-zoom
      scene.autoZoom();
    }
  }
View Full Code Here

Examples of syn3d.nodes.SceneNode

  }
 
    public void mouseClicked(MouseEvent e) {
    if (!handleMouseClicked) return;
     
    SceneNode scene = (SceneNode)e.getSource();

      // Control adds the new selection to the old
        // If not selected, then erase old selection
    if ((e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == MouseEvent.CTRL_DOWN_MASK) {
      scene.toggleSinglePick(e.getX(), e.getY());
    }
   
        // Shift selects everything in the rectangle region defined by the last click
    // position and this position
    else if (((e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == MouseEvent.SHIFT_DOWN_MASK)) {
      scene.toggleAllPicks(e.getX(), e.getY());
    }
   
    else scene.pick(e.getX(), e.getY());
   
    }
View Full Code Here

Examples of syn3d.nodes.SceneNode

    // This is a naive implementation, changing all nodes at the same time.
    // A more elaborate version could change only the "active" node, for example
    // the one selected in the JTree (if the JTree of ActiveNode is used).  
    int num = e.getKeyChar() - '0';
    if ((num>=0) && (num<=9)) {
      SceneNode scene = (SceneNode)e.getSource();
      ArrayList a = scene.findDescendantOfType(XYZResultNode.class);
      for (int i=0; i<a.size(); ++i) ((XYZResultNode)a.get(i)).showResult(num);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.