c# - iLNumerics isn't displaying my 3d plot - the plot remains 2d -
the code this:
//we need render locations. ilarray<float> ourpositions = oursimulator.getstars(); var scene = new ilscene(); var plotcube = scene.add(new ilplotcube(twodmode: false)); var ourposbuffer = new ilpoints(); ourposbuffer.positions = ourpositions; plotcube.add(ourposbuffer); plotcube.fieldofview = 120; plotcube.lookat = new vector3(0, 0, 0); ilstarchart.scene.configure();
now, earlier version of code (in different solution) still uses 3.3.2, ,
var plotcube = scene.add(new ilplotcube(null, false) )
i've tried both on 3.3.3 version, , neither displays 3d plot. instead, it's 2d grid. doing wrong here?
(the points are:
<single> [3,4] -32.00000 37.00000 36.00000 38.00000 54.00000 107.00000 106.00000 130.00000 -81.00000 -16.00000 -124.00000 -226.00000
)
edited: missing ) on 3.3.2 example
edited: reduced of non critical code out of example.
the expected result have 3d plot x,y , z axis. i'm getting 2d plot. no z axis. i've verified points (the tostring)
a sample run provides this: https://www.dropbox.com/s/imiw8tbe0lh8q9x/2dplot.png
this rough example of used, need add "ilsurface" plotcube
//replace , make sure added in order single[] zs = [all zs] single[] xs = [all xs] single[] ys = [all ys] //create array of points //something below ilarray<float> points = ilmath.zeros<float>(xs.length/s, s, 3); points[":;:;0"] = zs; points[":;:;1"] = xs; points[":;:;2"] = ys; // construct new plotcube , plot points scene = new ilscene(); cube = new ilplotcube(twodmode: false); surface = new ilsurface(points, colormap: colormaps.jet); //set scene properties scene.add(cube); //display cube in scene ilpanel1.scene = scene;
Comments
Post a Comment