graphics.points coordinates are borked(?)

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
weakman54
Prole
Posts: 7
Joined: Wed Mar 06, 2013 10:33 pm

graphics.points coordinates are borked(?)

Post by weakman54 »

So, I was gonna faff about with transformations to get a better grasp of how they worked, when I noticed something interesting:
wtfpoints.PNG
wtfpoints.PNG (6.84 KiB) Viewed 2414 times
Hmm, lets zoom in:
wtfpointsZoom.PNG
wtfpointsZoom.PNG (1.51 KiB) Viewed 2414 times
Ok, what? So calling points as (1, 1) will place the point one pixel above the rectangle, which has the starting point (1, 1)?
So did I find a bug, or is this intended?

If it's intended, why is it like this?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: graphics.points coordinates are borked(?)

Post by bartbes »

So first of all, the top-left is actually (0, 0), not (1, 1). The second thing you may be seeing, and this depends on drivers, is that points are usually drawn with the coordinate as its centre point. This means that (at least on most systems) drawing at (0.5,0.5) is the way to fill the pixel at (0, 0), and drawing at (0,0) actually fills all neighbouring pixels. Unfortunately points are just really awkwardly defined in OpenGL.
weakman54
Prole
Posts: 7
Joined: Wed Mar 06, 2013 10:33 pm

Re: graphics.points coordinates are borked(?)

Post by weakman54 »

Ah, that makes sense (and kind of not as well...)

This should probably be stated somewhere on the wiki pages for points and point =/
Edit: nevermind, it is there... However it might be higlighted a bit more?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 31 guests