|
@@ -9,6 +9,7 @@ import {
|
|
IS_LEAF,
|
|
IS_LEAF,
|
|
RANDOM_COLOR,
|
|
RANDOM_COLOR,
|
|
RANDOM_NODE_COLOR,
|
|
RANDOM_NODE_COLOR,
|
|
|
|
+ CUSTOM_COLOR_MODE
|
|
} from '../src/index.js';
|
|
} from '../src/index.js';
|
|
import {
|
|
import {
|
|
Scene,
|
|
Scene,
|
|
@@ -102,6 +103,17 @@ function reinstantiateTiles() {
|
|
tiles.manager.addHandler( /\.gltf$/, loader );
|
|
tiles.manager.addHandler( /\.gltf$/, loader );
|
|
offsetParent.add( tiles.group );
|
|
offsetParent.add( tiles.group );
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // Used with CUSTOM_COLOR_MODE
|
|
|
|
+ tiles.customColorCallback = ( tile, child ) => {
|
|
|
|
+
|
|
|
|
+ const depthIsEven = tile.__depth % 2 === 0;
|
|
|
|
+ const color = depthIsEven ? [ 255, 0, 0 ] : [ 255, 255, 255 ];
|
|
|
|
+
|
|
|
|
+ child.material.color.setRGB( ...color );
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function init() {
|
|
function init() {
|
|
@@ -253,6 +265,7 @@ function init() {
|
|
IS_LEAF,
|
|
IS_LEAF,
|
|
RANDOM_COLOR,
|
|
RANDOM_COLOR,
|
|
RANDOM_NODE_COLOR,
|
|
RANDOM_NODE_COLOR,
|
|
|
|
+ CUSTOM_COLOR_MODE
|
|
|
|
|
|
} );
|
|
} );
|
|
debug.open();
|
|
debug.open();
|