Page 1 of 1

I hate camera systems

Posted: Wed May 19, 2010 10:23 pm
by kikito
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?

Re: I hate camera systems

Posted: Wed May 19, 2010 11:24 pm
by bmelts
I would argue that an inverted camera feels more intuitive (to me, at least) - if I'm scripting an RPG, for instance, and in a cutscene I want the camera to show something that's offscreen to the right, I would tell it to pan to the right, thus moving everything to the left. This seems a lot more natural to me.

Re: I hate camera systems

Posted: Sat May 29, 2010 4:09 pm
by timmcd
I agree with anjo. I would love an inverted camera system! Get to work! *cracks whip*

Re: I hate camera systems

Posted: Mon May 31, 2010 10:04 am
by kikito
It is actually done. Pretty much. The message I sent on the other forum seems lost.

If you feel adventurous, it can be found here: http://github.com/kikito/passion/blob/m ... Camera.lua

Some cleanup is still due, and also I haven't started implementing scissoring. But it works ok, more or less.

Re: I hate camera systems

Posted: Wed Jun 02, 2010 8:44 pm
by Chief
Inverted camera system! Gief! Thumbs up! Yep yep!