简体   繁体   中英

What is the meaning of the third parameter in this dat.gui add function?

I am quite new with dat.GUI . I've been reading dat.gui's questions and answers in stackoverflow. I have one question from this one .

What is the meaning of the third argument in the gui.add function? ie A[i]

for (var i=1; i<7; i++) {
    controller_names[i] = A[i];
    gui.add(controller_names, i, A[i]);
}

Thanks!

The 3rd and higher arguments of the add function is for additional parameters to a given control. Example, if the control is a slider, it will be min & max, like:

gui.add(gui, 'Horizontale', 0, 600);

For check box control (boolean property, like A[i]), the third argument has no effect.

You can look at the definition of dat.controllers.factory in the source code of dat.gui , where all controllers are created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM