title: using plot3D to color rows in specific color
body: <p>I have a table <code>A</code> with 4000 rows and 3 columns, where x y z look like</p>
  
  <pre><code>x  y  z
  1  3  6
  2  4  6
  3  5  6
  5  2  5
  </code></pre>
  
  <p>I want to draw it with plot3D</p>
  
  <pre><code>library(plot3D)
  library(rgl)
  plot3d(A)
  </code></pre>
  
  <p>However, I want to make row 1-1000 color in red, 2000-3000 color in black,etc. How to get it please?</p>
  
  <p>Update: thanks for nongkrong's answer. I have the following code works:</p>
  
  <pre><code>plot3d(A,col=rep(1:4,each=1000))
  </code></pre>