rreusser / controls-state

⚙️ An object for managing state
https://observablehq.com/@rreusser/control-panel-2-prototype-test
21 stars 2 forks source link

Observable example is broken #14

Closed marcofugaro closed 4 years ago

marcofugaro commented 4 years ago

Hey, just an heads up, the main example on observable is broken

https://observablehq.com/@rreusser/control-panel-2-prototype-test

image

marcofugaro commented 4 years ago

This is because bundle.run is down: https://bundle.run/json-beautify@1.0.1

I solved it like this for now:

beautifyJSON = (str) => JSON.stringify(str, null, 2)
rreusser commented 4 years ago

Thanks! I've fixed and republished. Yeah, for the longest time I didn't know JSON had extra options.

Related but not applicable: to remove dependence on bundle.run, I've been making a PR here and there to add rollup config and add a dist bundle, e.g.: https://github.com/Jam3/orbit-controls/pull/16/files#diff-ff6e5f22a9c7e66987b19c0199636480

marcofugaro commented 4 years ago

Yeah it looks like that repo is not maintained anymore since mattdesl left Jam3, I also did a PR recently, no response.

I will contribute to @rreusser/orbit-controls if you decide to fork it 🙂

rreusser commented 4 years ago

Nice. Yeah, I really like the structure of that camera module, specifically that it's so easy to integrate with other solutions (i.e. not dependent on three.js or how you choose to use it). I started building a fancier controller in this notebook that splits this further into 1. a very simple abstract camera, and 2. an interaction controller with a stack of tools, each of which has the option to capture an interaction, otherwise it falls through to the next tool. So like when you tap, it first checks the vertex editor tool to see if you've tapped a point, otherwise it falls through to the camera. It's a step in the right direction but the semantics of interactions still isn't quite right. And I need to add touch controls. So my only nitpick on my perfect camera controller would be that it (IMO, ideally) has no idea what an event is, and then threre's a second tool that feeds in meaningful events. I built my solution on orbit-camera, which is my favorite because it has no idea what an event is.

I'm actually somewhat interested in building out a few loosely coupled tools in this domain because it's just driving me crazy to struggle so much with this. Thoughts welcome :)