vtk.js绘制三维点
时间: 2023-08-23 10:06:40 浏览: 242
.05, false, false, false, 40),
new Card(9, 6, 14, 0, 0.15, false, false, false, 55),
new Card(7, 7, 15, 0, 0要在vtk.js中绘制三维点,可以使用vtk.js中提供的vtkPoints和vtkGlyph3D类。以下.2, false, false, false, 50),
new Card(11, 4, 16, 0, 0是一个简单的例子:
```javascript
// 创建一个vtkPoints对象
const points = vtk.Common.Core.vtkPoints.newInstance();
.1, false, false, false, 45)
);
$cards2 = array(
new Card(8, 7, // 添加点
points.insertNextPoint(0, 0, 0);
points.insertNextPoint(1, 0, 014, 0, 0.1, false, false, false, 55),
new Card(9, 5, );
points.insertNextPoint(0, 1, 0);
points.insertNextPoint(0, 0, 1);
// 创建15, 0, 0.2, false, false, false, 50),
new Card(7, 8, 15, 0, 0.15, false, false, false, 60),
new Card(11, 3, vtkGlyph3D对象
const glyph = vtk.Filters.General.vtkGlyph3D.newInstance({
input: points,
});
// 设置glyph的16, 0, 0.05, false, false, false, 40),
new Card(10, 4, 属性
glyph.setInputArrayToProcess(0, 0, 0, vtk.Common.DataModel.vtkDataObject.FIELD_ASSOCIATION_POINTS16, 0, 0.1, false, false, false, 45),
new Card(12, 2, , 'Scalars');
glyph.setSourceConnection(vtk.Filters.Sources.vtkArrowSource.newInstance().getOutputPort());
glyph.setVectorModeToUse17, 0, 0.1, false, false, false, 35)
);
// 创建队伍
$team1 =Normal();
// 创建vtkActor对象
const actor = vtk.Rendering.Core.vtkActor.newInstance();
actor.getProperty().setPointSize(5); // 设置 new Team($cards1);
$team2 = new Team($cards2);
// 开始战斗
$battle = new Battle($team1, $team2);
$battle->start();
```
阅读全文