Are there some libraries or example codes, of a camera manager – a tool, that would move camera using some smooth lines (bsplines or similar)? So basically I request an animation to move to a new eye/center possition, and the tool takes care of the rest?
|
http://www.dhpoware.com/demos/glCamera3.html This is an easy to use OpenGL camera class. The code is very clean and easy to get into for understanding how it works. As far as animation, you'll still have to create your own. Be sure to check out their other demos, they have shared quite a bit of useful code. |
|||
|
|
|
I don't know of a tool specifically for cameras, but that's a pretty narrow requirement that is usually going to be part of a larger graphics/animation package rather than an independent camera-oriented library. If you're stuck implementing your own, it's not too hard. There are a few libraries that might help implementing it. The basic gist of what you're going to do is to tween between two positions/rotations, or tween an interpolant along a spline. http://libclaw.sourceforge.net/tweeners.html or http://code.google.com/p/cpptweener/ provide basic tweening; unsure if they'll meet your needs. Catmull-rom and b-spline interpolation is pretty easy to cook up on your own (I'd recommend catmull-rom over a b-spline for this use case), and I'm sure there's a decent library out there. You would combine that with the usual linear interpolation function for vectors (for camera position) and spherical interpolation function for quaternions (for camera angles). For the spline, you can define two splines to differentiate camera position and angle (e.g., the spline the camera moves along and a spline that defines the point the camera looks at). |
|||
|
|
