【发布时间】:2018-08-14 20:24:47
【问题描述】:
我是 ILNumerics 可视化引擎的新用户,我仍在快速了解如何很好地使用它。我已经广泛搜索了如何更新 ILSurface 的 z 值并阅读了帖子,但我仍然不清楚如何执行此操作。
我能够生成一个曲面并设置一个摄像头来查看它(Hamyo Kutschbach 告诉我这是确保在旋转曲面时不改变曲面纵横比的最佳方法,这在我的应用程序)。下面是显示 sin(x)/x 函数的代码:
// Generate the data
ILArray<double> z = SincFunc(rows, cols, 10, 50);
ILArray<double> x = new double[cols];
ILArray<double> y = new double[rows];
for (int i = 0; i < cols; i++)
x[i] = (double)i;
for (int i = 0; i < rows; i++)
y[i] = (double)i;
// create the scene
scene = new ILScene();
pointCloudSurface = new ILSurface(z, x, y)
{
Colormap = Colormaps.Jet,
UseLighting = true,
Wireframe = { Visible = false },
Children = { new ILColorbar()
{
Height = 0.5f,
Location = new PointF(0.95f, 0.05f),
Children = { new ILLabel("microns") { Position = new Vector3(0.5,1,0), Anchor = new PointF(0.5f,0) } } }
},
Alpha = 1.0f
};
// Configure the surface and display it
scene.Camera.Add(pointCloudSurface);
scene.Camera.Position = new Vector3(50, 50, 700);
scene.Camera.LookAt = new Vector3(50, 50, 0);
scene.Camera.Top = new Vector3(0, 0, 700);
scene.Camera.Projection = Projection.Perspective;
scene.Camera.ZNear = 1.0f;
scene.Camera.ZFar = 0.0f;
scene.Camera.Top = new Vector3(1, 0, 0);
// Turn off the Powered by ILNumerics label
scene.Screen.First<ILLabel>().Visible = false;
ilPanel1.Scene = scene;
ilPanel1.Configure();
ilPanel1.Refresh();
而且效果很好。所以现在我想在不关闭 ilPanel1 的情况下更改 z 值并更新绘图,因为该绘图嵌入在 Windows 窗体中。建议将不胜感激!希望其他新手也会发现这篇文章也很有用。
【问题讨论】:
标签: ilnumerics