// tunnel.java click on points, connect the dots import java.awt.*; import java.awt.event.*; public class tunnel extends Frame { int x, y, z, b; double xp[] = new double[1000]; double yp[] = new double[1000]; double zp[] = new double[1000]; int npts = 16; int nrngs = 8; int width = 400; int height = 400; int n, nold, nring, ngrp; double xmin = -1.0; double xmax = 1.0; double ymin = -1.0; double ymax = 1.0; double zmin = 2.0; double zmax, znext, zinc=0.5; // set up double buffering for smooth "run" Image dbImage; Graphics dbg; // double buffered graphics int speed = 100; // millisecond delay tunnel() { double ang; setTitle("tunnel"); setSize(width,height); setBackground(Color.white); setForeground(Color.black); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); n = 0; znext = zmin; // draw one ring for(int i=0; i