Menu

Draw a Line between 2 points in Plot3DPanel

2004-12-03
2013-03-22
  • Nobody/Anonymous

    How do I draw a line between <x,y,z> <x,y,z> points in the 3d sample graph you provide ?

    Thanks

     
    • JavierDiaz

      JavierDiaz - 2004-12-03

      I think you can follow the previous 2D post "lines between points" and extend to 3D, though I have not tried it.

       
    • Nobody/Anonymous

      What about the z coordinate ?  I can't seem to find a 3d constructor for the line type.

       
    • Nobody/Anonymous

      Anyone...please ?

       
    • Nobody/Anonymous

      in fact it's exactly the same thing than in 2D :

      if you just want to draw one line {x1,y1,z1} -> {x2,y2,z2} on your panel :
       
      Plot3Panel plot = new Plot3DPanel();
      RelativeCoord c1 = new RelativeCoord(new double[] { x1, y1,z1}, plot.getBase());
      RelativeCoord c2 = new RelativeCoord(new double[] { x2, y2 ,z2}, plot.getBase());
      plot.addPlotable(new Line(c1, c2, Color.red));

      that's all...

      yann

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.