a problem about Shape:getBoundingBox( ) in WIKI

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

a problem about Shape:getBoundingBox( ) in WIKI

Post 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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post by bartbes »

I think the docs are right.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post 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.
Last edited by kikito on Thu Jul 01, 2010 2:16 pm, edited 1 time in total.
When I write def I mean function.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post by bartbes »

That explains a lot.. now that I think of it that might be the problem.
poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post by poorenglish »

Yes,I understand it。
It is different understanding about the "bottom" and "top".
111.JPG
111.JPG (4.18 KiB) Viewed 1950 times
If OK,I will add this picture into wiki for this function,remind others not muddle
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post by TechnoCat »

User avatar
Maggots
Prole
Posts: 27
Joined: Sat Apr 24, 2010 10:38 pm
Location: Montréal, Québec, Canada

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post 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?
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post 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
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: a problem about Shape:getBoundingBox( ) in WIKI

Post by Robin »

I fixed it, you lazy farts! :P
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests