图形跟随camera
1 | const orientation = renderObject.renderer.getActiveCamera().getViewPlaneNormal(); // camera法向量 |
曾尝试actor.setOrientation失败 请使用source.setDirection
‘线’转为‘管道’
很多主流浏览器(包括Chrome)对webgl的实现中,设置线宽为1,在现阶段需要将line转为tube以实现‘线宽’1
2
3
4
5
6
7
8
9const updateTubeActor = (actor, polydata, lineWidth) => {
const filter = vtkTubeFilter.newInstance();
const mapper = actor.getMapper();
filter.setCapping(false);
filter.setNumberOfSides(10);
filter.setRadius(lineWidth);
filter.setInputData(polydata);
mapper.setInputConnection(filter.getOutputPort());
};
- setCapping
- setNumberOfSides
- setRadius