Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #22292
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Converting Text File To Rectangles |
| Date | 2013-02-13 09:06 -0800 |
| Organization | A noiseless patient Spider |
| Message-ID | <2rhnh817qca2g575nk2l0p6sqe2g8t03fi@4ax.com> (permalink) |
| References | <7f49c487-f016-43a3-83a4-feebe072f76c@googlegroups.com> <kfc7r5$rd1$1@dont-email.me> |
On Mon, 11 Feb 2013 21:02:47 -0500, Eric Sosman
<esosman@comcast-dot-net.invalid> wrote:
>On 2/11/2013 8:51 PM, Scyth3 wrote:
>> I have a save and load method for certain rectangles I need for a game. Say the user wants to save a map. The outputted map would look like this:
>>
>>
>> 50 250 50 50
>> 50 350 50 50
>> 50 400 50 50
>> 50 500 50 50
>> 150 300 50 50
>> 200 450 50 50
>> 200 500 50 50
>> 250 150 50 50
>> 300 100 50 50
>> 400 50 50 50
>> 450 150 50 50
>> 550 100 50 50
>>
>> X Y Width Height
>>
>> Now, how would I read this, and turn it into a rectangle?
>
> Turning it into twelve rectangles would be easy, but I don't
>know how you'd turn it into one. Perhaps you could keep track of
>the minimum X,Y and the maximum implied X,Y and form one rectangle
>that surrounds the entire thing. That rectangle might not be the
>minimal surrounding rectangle, but it would be minimal among those
>whose sides were parallel to the axes.
It would be a minimal regardless of whether the sides were
parallel to the axes. The vertices of each rectangle give the
furthest extent of the rectangle in one direction (or two in the
parallel case).
Sincerely,
Gene Wirchenko
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Converting Text File To Rectangles Scyth3 <zfollette@gmail.com> - 2013-02-11 17:51 -0800
Re: Converting Text File To Rectangles Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-11 21:02 -0500
Re: Converting Text File To Rectangles Gene Wirchenko <genew@telus.net> - 2013-02-13 09:06 -0800
Re: Converting Text File To Rectangles Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-13 13:25 -0500
Re: Converting Text File To Rectangles "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-02-15 15:25 +0000
Re: Converting Text File To Rectangles "John B. Matthews" <nospam@nospam.invalid> - 2013-02-16 13:37 -0500
[OT] Re: Converting Text File To Rectangles Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-16 15:16 -0500
Re: [OT] Re: Converting Text File To Rectangles "John B. Matthews" <nospam@nospam.invalid> - 2013-02-17 14:16 -0500
Re: Converting Text File To Rectangles Gene Wirchenko <genew@telus.net> - 2013-02-15 13:09 -0800
Re: Converting Text File To Rectangles Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-02-12 04:47 -0400
Re: Converting Text File To Rectangles lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-12 12:14 +0000
Re: Converting Text File To Rectangles lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-12 09:47 +0000
Re: Converting Text File To Rectangles lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-12 09:50 +0000
Re: Converting Text File To Rectangles Roedy Green <see_website@mindprod.com.invalid> - 2013-02-12 18:23 -0800
Re: Converting Text File To Rectangles Roedy Green <see_website@mindprod.com.invalid> - 2013-02-12 11:41 -0800
csiph-web