Skip to content

Commit

Permalink
opacity_slider
Browse files Browse the repository at this point in the history
  • Loading branch information
alonsoJASL committed Jun 5, 2024
1 parent 1c63f91 commit e7777c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/controller.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</tr>
<tr>
<td>
<input class='resolution' type='range' min='4' max='80' value='6' />
<input class='resolution' type='range' min='1' max='10' value='10' />
</td>
</tr>
</table>
11 changes: 9 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,16 @@ loadData('./data/data_coarse_scaled.vtk').then((polydata) => {

const light = vtkLight.newInstance();
light.setPosition(1, 1, 1);
light.setFocalPoint(0, 0, 0);
light.setIntensity(0.4);
renderer.addLight(light);

const light2 = vtkLight.newInstance();
light2.setPosition(-1, -1, -1);
light2.setFocalPoint(0, 0, 0);
light2.setIntensity(0.6);
renderer.addLight(light2);

renderWindow.render();

}).catch((error) => {
Expand All @@ -158,8 +165,8 @@ representationSelector.addEventListener('change', (e) => {
});

resolutionChange.addEventListener('input', (e) => {
const resolution = Number(e.target.value);
currentSource.setResolution(resolution);
const opacity = Number(e.target.value);
actor.getProperty().setOpacity(opacity/10);
renderWindow.render();
});

Expand Down

0 comments on commit e7777c7

Please sign in to comment.