Pregunta

I need to put a link within the control dat.gui to open an html file, How to do this ? I have already put levels of transparency and checkbox but do not know how do to open a link.

¿Fue útil?

Solución

This has nothing to do with Three.js. Anyway, just pass a function variable/member like you would do other controls... It will create a button with your function in onclick. Example:

var obj = {};
obj.sampleNumber = 1;
obj.sampleLink = function() {
  window.open("myfile.html");
}
var gui = new dat.GUI();
gui.add(obj, 'sampleNumber', -5, 5);
gui.add(obj, 'sampleLink');
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top