以下是主要显示代码
public void SetElevation(vtkPoints points, ref vtkRenderer render)
{
//数据源
vtkPolyData polydata = vtkPolyData.New();
polydata.SetPoints(points);
double[] bounds = points.GetBounds();
//滤波器
vtkVertexGlyphFilter glyphFilter = vtkVertexGlyphFilter.New();
glyphFilter.SetInputConnection(polydata.GetProducerPort());
vtkElevationFilter filter = vtkElevationFilter.New();
filter.SetInputConnection(glyphFilter.GetOutputPort());
filter.SetLowPoint(0, 0, bounds[4]);
filter.SetHighPoint(0, 0, bounds[5]);
//filter.SetLowPoint(0, 0, -1);
//filter.SetHighPoint(0, 0, 1);
//lut
vtkLookupTable lut = vtkLookupTable.New();
lut.SetHueRange(0.6, 0);
lut.SetSaturationRange(0.5, 1);
lut.SetValueRange(1, 1);
//映射器
vtkPolyDataMapper mapper = vtkPolyDataMapper.New();
mapper.SetLookupTable(lut);
mapper.SetInputConnection(filter.GetOutputPort());
//演员
vtkActor actor = vtkActor.New();
actor.SetMapper(mapper);
actor.GetProperty().SetPointSize(1);
//渲染
vtkCamera cam = vtkCamera.New();
cam.SetFocalPoint(0, 0, 0);
cam.SetPosition(bounds[1] - bounds[0], bounds[3] - bounds[2], 700);
cam.SetPosition(bounds[1] - bounds[0], 100, 800);
cam.ComputeViewPlaneNormal();
cam.SetViewUp(0, 1, 0);
cam.Zoom(2);
render.SetActiveCamera(cam);
render.AddActor(actor);
}