通过 SetSampleDistance () 来设置每条射线的采样步长,默认值为1,单位为世界坐标系单位,数值越小越精细
通过 SetImageSampleDistance () 来设置图像采样距离,默认值为1,即投射光线的间隔数值越小越精细
核心代码如下
const cropFilter = vtkImageCropFilter.newInstance();
const reader = vtkHttpDataSetReader.newInstance({ fetchGzip: true });
const actor = vtkVolume.newInstance(); const mapper = vtkVolumeMapper.newInstance(); mapper.setSampleDistance(1); actor.setMapper(mapper);
actor.getProperty().setUseGradientOpacity(0, true);//设置渐变色
cropFilter.setInputConnection(reader.getOutputPort()); mapper.setInputConnection(cropFilter.getOutputPort());
增加功能前

增加功能后








![[附源码]计算机毕业设计JAVA闲置物品线上交易系统](https://img-blog.csdnimg.cn/bbd4bc35d2be4b5a9d7097e291a67326.png)


![L. Paid Leave(贪心)[CCPC Finals 2021]](https://img-blog.csdnimg.cn/6506b439fac14d668f9eadd877d23f9d.png)



![[附源码]计算机毕业设计JAVA鲜花销售管理系统](https://img-blog.csdnimg.cn/e7ce9c3ed2d14927a43ef29b58df40ec.png)




