Skip to content

Commit bf47cde

Browse files
committed
More clean up.
1 parent 79f5a01 commit bf47cde

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

examples/webgl_clipping_intersection.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,21 @@
9292
mode = {};
9393
mode.clipIntersection = true;
9494
mode.clipPosition = 0;
95+
9596
var gui = new dat.GUI();
96-
gui.add( mode, 'clipIntersection' ).onChange( function() {
97-
for (var i = 0; i < balls.children.length; i++) {
98-
balls.children[i].material.clipIntersection = !balls.children[i].material.clipIntersection;
99-
}
100-
} );
97+
gui.add( mode, 'clipIntersection' ).onChange( function () {
98+
99+
var children = group.children;
101100

102-
gui.add( mode, 'clipPosition', -16, 16 ).onChange( function( value ) {
101+
for ( var i = 0; i < children.length; i ++ ) {
102+
103+
var child = children[ i ];
104+
child.material.clipIntersection = ! child.material.clipIntersection;
105+
106+
}
103107

104108
} );
109+
gui.add( mode, 'clipPosition', -16, 16 );
105110

106111
// Controls
107112

0 commit comments

Comments
 (0)