I hate camera systems

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

I hate camera systems

Post 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?
When I write def I mean function.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: I hate camera systems

Post 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.
timmcd
Prole
Posts: 8
Joined: Fri Dec 25, 2009 12:07 am

Re: I hate camera systems

Post by timmcd »

I agree with anjo. I would love an inverted camera system! Get to work! *cracks whip*
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: I hate camera systems

Post 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.
User avatar
Chief
Party member
Posts: 101
Joined: Fri Mar 12, 2010 7:57 am
Location: Norway, 67° north

Re: I hate camera systems

Post by Chief »

Inverted camera system! Gief! Thumbs up! Yep yep!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 8 guests