import '@kitware/vtk.js/favicon';
import '@kitware/vtk.js/Rendering/Profiles/Geometry';
import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor'; import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource'; import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper'; import vtkFullScreenRenderWindow from '@kitware/vtk.js/Rendering/Misc/FullScreenRenderWindow';
const renderWindow = vtkFullScreenRenderWindow.newInstance({ background: [0.2, 0.3, 0.4], }); const renderer = renderWindow.getRenderer();
const coneSource = vtkConeSource.newInstance({ height: 1.0 });
const mapper = vtkMapper.newInstance(); mapper.setInputConnection(coneSource.getOutputPort());
const actor = vtkActor.newInstance(); actor.setMapper(mapper);
renderer.addActor(actor); renderer.resetCamera();
|