I hate camera systems
Posted: Wed May 19, 2010 10:23 pm
After lots of hair pulling, head scratching and lip biting, my camera system sucks a little less every day.
I've come to a point in which I'd appreciate some feedback from the community, hence I ask:
How do you like Cameras to behave?
Let me explain this a bit more.
My camera sytem works on top of love.graphics operations: rotate, translate, scale, push and pop.
These operations are "direct". If you say "translate 20 pixels to the right" everything drawn afterwards is drawn 20 pixels to the right.
My camera sytem works that way now.
Trouble is, that's not how real cameras work. They are "inverted": If you move real cinema camera "20 meters right" everything on the camera's screen moves, yes ... but to the left!
So that is my dilemma. I'm wondering whether I should "invert" my camera system by default.
An inverted camera system has some advantages; you want to focus on an object that is on coordinates x,y? Just put the camera on those positions. Want to align the camera angle with an object's angle? Just call setAngle(object.angle). With a "direct" system, you have to invert the numbers, which is less obvious and a bit of a pain sometimes.
A direct camera, on the other hand, would be (I guess) more intuitive to OpenGL-familiar guys.
So what do you think?
I've come to a point in which I'd appreciate some feedback from the community, hence I ask:
How do you like Cameras to behave?
Let me explain this a bit more.
My camera sytem works on top of love.graphics operations: rotate, translate, scale, push and pop.
These operations are "direct". If you say "translate 20 pixels to the right" everything drawn afterwards is drawn 20 pixels to the right.
My camera sytem works that way now.
Trouble is, that's not how real cameras work. They are "inverted": If you move real cinema camera "20 meters right" everything on the camera's screen moves, yes ... but to the left!
So that is my dilemma. I'm wondering whether I should "invert" my camera system by default.
An inverted camera system has some advantages; you want to focus on an object that is on coordinates x,y? Just put the camera on those positions. Want to align the camera angle with an object's angle? Just call setAngle(object.angle). With a "direct" system, you have to invert the numbers, which is less obvious and a bit of a pain sometimes.
A direct camera, on the other hand, would be (I guess) more intuitive to OpenGL-familiar guys.
So what do you think?