Skip to main content
GameDev.net gamedev.net
🔒 Locked

Programmable Cameras

Started by redcliffe May 10, 2003 at 3:06 AM 2 replies 1k views
Original Post
redcliffe
redcliffe
I''m developing a camera class that will let me do the normal camera stuff, but it will also let me program a sequence of shots, panning, zooming etc like a real camera in a movie. Has anyone here done this, and come across gotchas and problems that I may not have thought about? At the moment I store in my class, the position of the camera, the spherical angles of where it''s pointing, it''s roll, and fov. This is all stored in a std::vector. Should I go to the effort of developing a full camera scripting system for this stuff? Thanks, David
Sneftel
Sneftel
I suggest subclassing. Have different "camera operators" that can operate the camera in different ways. The "follow" camera operator will follow a particular object at a given distance. The "zoom" operator will zoom the camera to a particular magnification, moving the FOV at a particular rate. The "just sit there" operator will just sit there. The "SLERP" operator will do a spherical rotation of the camera to a particular quaternion rotation. The "shaky" operator will use another operator''s movement, but then add a particular amount of jitter to the camera. Etc., etc. A camera has exactly one operator at any given time (although the "shaky" operator may have another operator itself).


How appropriate. You fight like a cow.
dopeflow
dopeflow
You could have a set of "frames" just like in animation for the camera which would essentially store the camera view/position/up vector for each frame. Then when you play the animation you interpolate between each frame just like you do with an animated model so that you get smooth transition.

I dont really know i never implemented one, but this could be a way to handle it.
higherspeed
higherspeed
I''d go with a mixture of the two solutions posed so far. So each node will point to the next, but each one could have a different transition. My camera system currently only has 3 states, one with a stationary origin, which just looks at an entity, one that travels toward a node, looking at an entity. Then one that follows an entity with a fixed distance. But I will add far more.

If you want to make it look really good, then it would have to be scripted, although I''m sure that can just be incorporated to any level scripting you already have.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.