Skip to content

Instantly share code, notes, and snippets.

@mrdoob
Created September 24, 2011 00:47
Show Gist options
  • Save mrdoob/1238790 to your computer and use it in GitHub Desktop.
Save mrdoob/1238790 to your computer and use it in GitHub Desktop.
Logging the Scene Graph
function logGraph( object, depth ) {
var depth = depth || 0, pad = '';
for ( var i = 0; i < depth; i ++ ) pad += ' ';
console.log( pad + object.name, object );
for ( var i = 0; i < object.children.length; i ++ ) {
logGraph( object.children[ i ], depth ++ );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment