Hi, I ported a three.js example over to observablehq and tried to use generators for the mouse movement and the animation.
It does work on obersablehq but when embedding it, it looks like the generators are not running:
As a sidequestion: Is this style of using events / requestAnimations via an generator a good idea ? Somehow I always end up trying to use generators for everything on observablehq. But maybe the good old fashioned callbacks and eventhandler are the better way ?
I like to inspect what is going on, without using console.log or using a mutable.
You don’t need scene or camera because they are already referred to explicitly in your code for canvas. That suggests that you might also get around this problem by referring to light and geometry in your code for canvas. Something like: