Page 1 of 1
a problem about Shape:getBoundingBox( ) in WIKI
Posted: Wed Jun 30, 2010 2:02 pm
by poorenglish
Hello;
In the wiki the Shape:getBoundingBox( ) description is "x1, y1, x2, y2, x3, y3, x4, y4 = Shape:getBoundingBox( )
Vertexes are returned starting in the
top-left in a counterclockwise fashion (top-left, bottom-left, bottom-right, top-right)"
--
http://love2d.org/wiki/Shape:getBoundingBox
I found in the "Tutorial:Physics" use this function.--
http://love2d.org/wiki/Tutorial:Physics
Actually the "Vertexes are returned starting in the
bottom-left in a clockwise fashion(bottom-left,top-left,top-right,bottom-right)
Is this a mistake for the wiki?
Thks
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Wed Jun 30, 2010 2:32 pm
by bartbes
I think the docs are right.
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Wed Jun 30, 2010 3:11 pm
by kikito
I suspect the this is another of those issues that come from the way LÖVE interprets the "y" coordinate when drawing - opposite as the "natural" (call it whatever you want) way to interpret it.
I'm not saying that LÖVE's way should be corrected, mind you; I'm just saying that its peculiarities must be taken into account. I had this same problem myself.
When I first read "Top" I assumed it meant "higher on the screen". I then learnt that it meant "the maximum <<y>> value", which is the opposite when drawing. This leads to a lot of interesting surprises; clockwise gets transformed in counter-clockwise.
The same goes for "Bottom"; they are kind of misleading words on this context.
I propose changing the documentation so all the "Top" and "Bottom" read "Maximum y" and "Minimum y" instead.
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Wed Jun 30, 2010 3:47 pm
by bartbes
That explains a lot.. now that I think of it that might be the problem.
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Thu Jul 01, 2010 12:23 pm
by poorenglish
Yes,I understand it。
It is different understanding about the "bottom" and "top".
- 111.JPG (4.18 KiB) Viewed 2151 times
If OK,I will add this picture into wiki for this function,remind others not muddle
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Thu Jul 01, 2010 1:36 pm
by TechnoCat
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Thu Jul 01, 2010 1:40 pm
by Maggots
Vertexes are returned starting in the top-left in a counterclockwise fashion (top-left, bottom-left, bottom-right, top-right).
That isn't right.
When will it be changed?
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Thu Jul 01, 2010 7:45 pm
by TechnoCat
Maggots wrote:Vertexes are returned starting in the top-left in a counterclockwise fashion (top-left, bottom-left, bottom-right, top-right).
That isn't right.
When will it be changed?
You tell me
http://love2d.org/w/index.php?title=Sha ... ction=edit
Re: a problem about Shape:getBoundingBox( ) in WIKI
Posted: Thu Jul 01, 2010 8:06 pm
by Robin
I fixed it, you lazy farts!