• Auction
40k Pics 12k Videos
MapleStory 2
54 Pics 23 Videos
Mobile Games
1 Pic
Art, Anime & Manga
28 Pics 8 Videos
L.o.L., Minecraft, Pokemon, +
24 Pics 24 Videos
7 Pics 4 Videos
Sony PS3 & PS4
1 Pic 7 Videos
Xbox 360 & One
2 Pics 8 Videos
MapleStory guides, forums, screens, videos, auctions and new friends await! Signup or login
Mar 07 12
Windia Chief Bandit
So I'm fairly new to object orientated Java programming and our teacher wants us to creat a rectangle, and any other 5+ Sided shape and my rectangle and that shape are very messed up.. I'm not sure what order to put my points in, so if someone can help that would be great. The rectangles code and how it looks are here:

Code Picture

And the other 5+ sided (real known shape)

Code Picture

thank you for any help!
Mar 07 12
In general, you should define a polygon by defining the points clockwise or counterclockwise. According to the API, a line segment will form between the last point and the first, so you have to take that into account.
Mar 08 12
Windia Chief Bandit
Alright. I kind of get that, anyway you know what I can do to my code to make it work correct. I'll change my points to clockwise.
Mar 08 12
Make the last y-coordinate be yPosition.
Mar 08 12*
Windia Chief Bandit
I love you Any idea on helping me with my other shape, I'm tinkering on my own hoping to strike gold soon!
Mar 08 12*
I inputted the data into a very old program of mine and the following came out that SHOULD make it work:

50 0
75 -15
100 0
100 8
75 15
50 8

Unfortunately, converting that back to code would take quite a bit of time.

Again, I'm not certain if the output is correct since I haven't tested it for a while, but the general goal is to form a "convex hull" in the way you form your polygon. Otherwise, it might have difficulty forming the correct polygon.

Register / login
You must be a member to reply or post. signup or login