You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2022. It is now read-only.
I just got started with ThreeJS and the devtool is very nice to experiment with the lights and the scene's composition! Thank you!
I saw on the Chrome Store comments that some users have trouble using the extension though.
Wouldn't it be nice to add an example in the README file to explain to new users how to implement the observer code?
Maybe something like this:
Current API
This API has not been thought out at all, but this will register your
THREE.Scene and THREE.Renderer to be observed by the tools.
// Observe a scene or a rendererif(typeof__THREE_DEVTOOLS__!=='undefined'){__THREE_DEVTOOLS__.dispatchEvent(newCustomEvent('observe',{detail: scene}));__THREE_DEVTOOLS__.dispatchEvent(newCustomEvent('observe',{detail: renderer}));}
Simply add it at the end of your animate loop, like this:
functionanimate(){requestAnimationFrame(animate);// ...// Observe a scene or a rendererif(typeof__THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(newCustomEvent("observe",{detail: scene}));__THREE_DEVTOOLS__.dispatchEvent(newCustomEvent("observe",{detail: renderer}));}}