Is it possible to use the Three.js OrbitController in NGL?
I'd like to be able to swap out the Trackball controller for a different one, e.g. Three.OrbitController. Is that possible? I'd be willing to work on a PR if that's considered useful.
Hmm - one for @arose but I'll have a go at answering:
I guess so - the main difference between the two seems to be how you translate from mouse movements to rotation matrices and that's in the TrackballControls class currently (which incidentally doesn't look very much like the one in three.js!)
So... you could pull it out into a base class CameraControls? and TrackballControls and OrbitControls which implement the pan/rotation methods differently?
Sounds doable, what's your use-case? (playing with the threejs example it seems to keep one axis always pointing "up" - ie. you can't turn the scene upside down)
Thanks @fredludlow; I may take a crack at that. Breaking out controls as a separate class makes sense (the way three.js does it). You can go upside down with OrbitControls if you set things up properly, but yes, it does a much better job of preventing accidental tilt (camera Z axis rotation). I think my users will find orbit-style controls more intuitive. There are other things I'd like to do to improve the camera control UX -- so breaking it out into a substitutable class seems like a good first step. Glad I'm not missing something that's already there.
I concur with @fredludlow assessment.