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 » Wed Sep 13, 2017 10:07 am

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 272 times
Hmm, lets zoom in:
wtfpointsZoom.PNG
wtfpointsZoom.PNG (1.51 KiB) Viewed 272 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: 4856
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: graphics.points coordinates are borked(?)

Post by bartbes » Wed Sep 13, 2017 10:16 am

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.
Cowardly acts and the eating of birds must not be the deeds of a Hero of Storms.

weakman54
Prole
Posts: 7
Joined: Wed Mar 06, 2013 10:33 pm

Re: graphics.points coordinates are borked(?)

Post by weakman54 » Wed Sep 13, 2017 11:33 am

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: No registered users and 12 guests