drcmda
April 27, 2020, 12:28pm
1
not sure if react-specific showcases are considered OK, but i published this yesterday, could turn into a nice collection of useful helpers: https://github.com/react-spring/drei
if you click the sandbox links you can see it working. these are mostly abstractions for boilerplate-heavy primitives. saw myself repeating set-up code for things like controls, wiring up update loops, etc, so i thought: why not make it re-usable. all these components are self-managed and will clean up on unmount.
2 Likes
looeee
April 27, 2020, 1:00pm
2
Seems fine to me. Although I think this would fit better in Resources than Showcase.
3 Likes
looeee
April 29, 2020, 4:03am
3
What do you mean by a “responsive” camera by the way? Just that it automatically resizes to fit the browser?
drcmda
April 29, 2020, 3:53pm
4
yep, that’s basically it. not much to it, but aspect ratio and resize is taken care of since the canvas sits inside a resizeobserver.
1 Like
looeee
April 30, 2020, 9:06am
5
I’ve been avoiding using resizeObserver because caniuse reports only 70% support . Do you polyfill this? Or can it be transpiled?
drcmda
April 30, 2020, 9:10am
6
yes, it’s polyfilled where missing, i would recommend @juggle/resize-observer
we made a utility lib for it, it even works in nested scroll containers which was a nightmare to get right: https://github.com/react-spring/react-use-measure
1 Like