PDA

View Full Version : auto cam for graphics scene



Cruz
4th May 2014, 22:30
Hello!

I would like to implement an auto cam feature in a QGraphicsView widget. The scene to be observed is much like a top down view shooter game, like the first versions of GTA. There is no shooting, but an animated character walks around and the camera should follow him. On one hand, the center point of the character is the only point of interest (POI) and this makes the task sound easy. On the other hand, it turns out that it's not. :) I experimented a bit with simple camera logic, like when the POI reaches the border, the camera starts moving smoothly and centers on the POI. Getting the camera velocity right, handling zoom, and still maintaining some possibility to drag the scene with the mouse, make this a tedious and difficult task. Does anyone know of some sort of a package or library that can handle this? Or perhaps all it takes is a smart idea?

Thanks,
Cruz