Sunday 15 July 2012

javascript - [three.js toggle through models using GUI -



javascript - [three.js toggle through models using GUI -

i models in scene , using dat.gui able toggle through different models.

so far have tried doing changing visibility on/off using code:

var gui = new dat.gui(); var controls = { toggleobjects: function(){ g3white.traverse(function(child){child.visible = true;}); g3black.traverse(function(child){child.visible = false;}); } }; gui.add(controls, 'toggleobjects');

however, maintain getting errors break code: uncaught typeerror: undefined not function

additionally, have more 2 models , @ click of button model displays , other hidden.

is best/easiest way go or there else should do?

any help appreciated, i'm sort of three.js beginner.

you should traversing scene, checking if kid object want , turning on/off visibility.

javascript three.js

No comments:

Post a Comment