2

How can I add line, like I drew in Paint with ILNumerics? My scene is building with that code:

 ilPanel1.Scene = new ILScene()
 {
     new ILPlotCube(twoDMode: false)
    {
        new ILSurface(func,
                     xmin: (float)xmin,
                     xmax: (float)xmax,
                     ymin: (float)ymin,
                     ymax: (float)ymax,
                     xlen: 200,
                     ylen: 200,
                     colormap: Colormaps.ILNumerics),
    }
};

http://i.imgur.com/7BTMmDd.png

edited:

var line = ilPanel1.Scene.Camera.Add(Shapes.Line);
ILArray<float> angles = ILMath.linspace<float>(0, 6, 6);
ILArray<float> pos = ILMath.zeros<float>(1,1,1);
pos["0;:"] = (float)xt; pos["1;:"] = (float)yt;
pos["2;:"] = 0f;
line.Positions = pos;
line.Color = Color.Black;
Andrey Saleba
  • 2,167
  • 4
  • 20
  • 27
  • 1
    Thanks for providing an image which explains more than 1000 words – user492238 Apr 20 '15 at 21:12
  • What is in `line.Positions` after the line `line.Positions = pos`? Keep in mind that you are in Camera space here. You could add the line shape to the plotcube if you need the same coordinates for the line. – Haymo Kutschbach Apr 27 '15 at 15:55

1 Answers1

2

It is as simple as this:

ilPanel1.Scene.First<ILPlotCube>().Add(
    new ILLines(/* do your line setup here */)
); 

See the documentation of shapes here: http://ilnumerics.net/drawable-nodes-shapes.html

user492238
  • 4,094
  • 1
  • 20
  • 26