Skip to content

Commit

Permalink
More clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Oct 15, 2016
1 parent 79f5a01 commit bf47cde
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions examples/webgl_clipping_intersection.html
Expand Up @@ -92,16 +92,21 @@
mode = {};
mode.clipIntersection = true;
mode.clipPosition = 0;

var gui = new dat.GUI();
gui.add( mode, 'clipIntersection' ).onChange( function() {
for (var i = 0; i < balls.children.length; i++) {
balls.children[i].material.clipIntersection = !balls.children[i].material.clipIntersection;
}
} );
gui.add( mode, 'clipIntersection' ).onChange( function () {

var children = group.children;

gui.add( mode, 'clipPosition', -16, 16 ).onChange( function( value ) {
for ( var i = 0; i < children.length; i ++ ) {

var child = children[ i ];
child.material.clipIntersection = ! child.material.clipIntersection;

}

} );
gui.add( mode, 'clipPosition', -16, 16 );

// Controls

Expand Down

0 comments on commit bf47cde

Please sign in to comment.