Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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).

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.