Exemplo n.º 1
0
 public CameraApp() {
   ball.setXYZ(0.0, 0.0, 0.0);
   ball.setSizeXYZ(0.5, 0.5, 0.5);
   ball.getStyle().setFillColor(Color.YELLOW);
   // right wall
   wallR.setXYZ(6.0, 0.0, 0.0);
   wallR.setSizeXYZ(0.2, 4.0, 4.0);
   wallR.getStyle().setFillColor(Color.GREEN);
   // left wall
   wallL.setXYZ(-6.0, 0.0, 0.0);
   wallL.setSizeXYZ(0.2, 4.0, 4.0);
   wallL.getStyle().setFillColor(Color.GREEN);
   // Add the objects
   panel.setPreferredMinMax(-6, 6, -6, 6, -6, 6);
   panel.getInteractionTarget(org.opensourcephysics.display3d.core.DrawingPanel3D.TARGET_PANEL);
   panel.addInteractionListener(this);
   panel.addElement(ball);
   panel.addElement(wallR);
   panel.addElement(wallL);
   DrawingFrame3D frame = new DrawingFrame3D();
   frame.setDrawingPanel3D(panel);
 }