Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Making Polygon...

Author
Message
Subbir
11
Years of Service
User Offline
Joined: 20th Jun 2012
Location:
Posted: 3rd Jul 2012 07:36
I have a problem with making a polygon. I have attached an image with this post... Can Anyone help me?? Its not working... I have bound the shape with 8points, though its not working... When I turned on my physicsDebug, it shows like this image....

Subbir Rahman

Attachments

Login to view attachments
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 3rd Jul 2012 09:46
We need an example on how you programmed it.

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Jul 2012 10:43 Edited at: 3rd Jul 2012 16:35
That's weird, I thought I answered this post last night... must have been half asleep!

I made a free tool for creating polygon shapes here: http://forum.thegamecreators.com/?m=forum_view&t=194938&b=48

When making polygon shapes in box2d you have to;
1-Create the shape in a clockwise order
2-Make convex shapes only
3-Use multiple shapes to create concave shapes

My tool makes it a bit easier by not allowing you to create invalid shapes and outputting an easily loadable shape definition file (Tier 1 code provided).

Hope it helps!

EDIT: I did answer this same question from you last night. Please don't post multiple threads about the same subject it is really not necessary and will only annoy people. Your original thread here: http://forum.thegamecreators.com/?m=forum_view&t=198298&b=41


this.mess = abs(sin(times#))
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 3rd Jul 2012 11:17
I really don't understand why OpenGL will not permit convex polygons. It's easy using the Windows graphics functions.

-- Jim
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 3rd Jul 2012 12:25 Edited at: 3rd Jul 2012 21:03
EDIT: convex >> concave.

I think it's the Box2D physics system that does not allow concave polygons. The polygons made in AppGameKit just define the zone around an object to check for physics collisions. The OpenGL can draw concave polygons, but since you can not make graphical polygons in AppGameKit, you can't use that. The only reason the polygons are visible, is because the physics debug option is on to graphically visualize the objects physic forms. I guess Baxslash simulate polygon graphics in his tool by making individual stretched and rotated sprites for each line in the polygons.

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 3rd Jul 2012 12:54
Thanks, Impetus - that explains it.

My Windows teaching exercise creator allows you to be in edit or test run mode. In edit mode you can create polygonal regions on a background image. Any number of points, any old ins and outs. In edit mode these lines are rendered as you work. At run time a sprite is created with whatever fill properties you want. These can be invisible, but active and associated with an action. So you can have a series of words in the target language like "Nose" "Eye" "Hand" and the user can drag these and drop them. (Or click). The drop triggers an action - typically OnRight or OnWrong. This can flash the polygonal region if it's correct, for example.

It's handy because you do not have to save dozens of images - just the poly-points.

-- Jim
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Jul 2012 14:01
@Impetus73 is right, it's a Box2D restriction. It's the same using the DBPro Box2D plugin.

My tool just uses sprites and the standard debug display as you also suggested.


this.mess = abs(sin(times#))
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Jul 2012 15:51
Just as a quick note, it looks like the meaning of convex and concave have been switched in this thread, convex is good shape and concave is the bad one. The way I always remember it is concave has an indent that forms a sort of cave
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 3rd Jul 2012 16:13
Oh yes Paul, thanks for the correction! Any time plan for the 1077 release?

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Jul 2012 16:19
Lee handles the releases and he's on holiday until next week so definitely not before then. However we are also very busy at the moment so I can't say when it might be.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Jul 2012 16:34
Oops, I'll edit my post so as not to confuse people too much... thanks for pointing that out Paul! Brain frt


this.mess = abs(sin(times#))

Login to post a reply

Server time is: 2024-05-04 10:05:39
Your offset time is: 2024-05-04 10:05:39