Вопрос

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.

Это было полезно?

Решение

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');
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top