title: Plotting lines between two points in 3D
body: <p>I am writing an regression algorithm which tries to "capture" points inside boxes. The algorithm tries to keep the boxes as small as possible, so usually the edges/corners of the boxes go through points, which determines the size of the box.</p>
  
  <p>Problem: I need graphical output of the boxes in R. In 2D it is easy to draw boxes with <code>segments()</code>, which draws a line between two points. So, with 4 segments I can draw a box:</p>
  
  <pre><code>plot(x,y,type="p")
  segments(x1,y1,x2,y2)
  </code></pre>
  
  <p>I then tried both the <code>scatterplot3d</code> and <code>plot3d</code> package for 3D plotting. In 3D the <code>segments()</code> command is not working, as there is no additional z-component. I was surprised that apparently (to me) there is no adequate replacement in 3D for <code>segments()</code> </p>
  
  <p>Is there an easy way to draw boxes / lines between two points when plotting in three dimensions ?</p>