This example recreates the zoom and pan behavior from the Pan and Zoom II D3 example. I'm using Three.js in a 2D data-visualization project because I'm hoping its WebGL render can handle more points than canvas. I had a hard time finding an example that zoomed and panned like I'm used to, so I made this.
This stack overflow answer by WesleyJones and the
getCurrentScale function from anvaka's
three.map.controls code was essential to me actually getting this working.
The scroll zoom is currently inverted compared to the D3 example, I'd like to match it but apparently there's some easing happening in the D3 scroll behavior that slows things down as you zoom in. That makes it feel weird if I just invert the zoom.
If you have suggestions on how to make this better, message me on [Twitter](htt