ReadyWater
YaBB Newbies
Offline
Posts: 9
Toronto
"Camera" follow in 2d mode?
Jan 30th , 2009, 3:07am
Hello, I've been trying to figure out how to make a camera follow my objects in 2D space. Not really sure how to approach it on a conceptual level. Specifically, I've got a bunch of objects in an array moving about according to points determined by the mouseclick on the screen using push/pop matrix and translate. So my goal with this project is to have the objects moving about independently (the clicking was just a sort of "okay, I'm at this stage type thing"). With the camera, my issue is: how does the coordinate system work then? If the coordinates are determined by the pixels on the initial 640x480 screen, then how would a camera determinte "itself," so to speak...? Wouldn't I have to modify the objects themselves in relation to where I believe the camera should be, eg: expanding/contracting the elipses to simulate zoom, reducing speed/trajectory to simulate panning, etc? Anyway, my goal: as the objects move about and converge independently, I would like to have a camera "following" them with varying degrees of lag and zooming and whatnot... Is there a way to do this in actuality, or would I have to simulate it within the movement functions of the objects themselves? This is the "sketch" so far... http://openprocessing.org/visuals/?visualID=930 There's nothing re: a camera in here, but it'll give you an idea of where I am/what my goal is... hopefully. I'm very, very new to processing and this is all I've managed to come up with so far inbetween school work, which is unfortunately poli sci oriented. Many thanks!