S
S
sortfact3332021-05-15 14:58:34
JavaScript
sortfact333, 2021-05-15 14:58:34

How to replace gui with your interface?

I want to use my own interface instead of dat.gui.
But I don't understand how to adapt

import { GUI } from './dat.gui.module.js';

gui.add( sliceZ, "index", 0, volume.RASDimensions[ 2 ], 1 ).name( "indexZ" ).onChange( function () {

  sliceZ.repaint.call( sliceZ );

} );			

gui.add( volume, "lowerThreshold", volume.min, volume.max, 1 ).name( "Lower Threshold" ).onChange( function () {

  volume.repaintAllSlices();

} );

Into something like this

<input id="test_range" type="range" max='240' min="1">
<script>
document.getElementById("test_range").addEventListener("change", function() {
  sliceX.index = this.value
  console.log(this.value)
});
</script>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question