Forums Archived

The forums are being archived. See this topic for more information.

How do you get your poly coordinates for Chipmunk?

Get help and support with Rubygame

How do you get your poly coordinates for Chipmunk?

Postby antihcl » Tue Jul 07, 2009 9:42 am

I'm finding it to be sort of a pain to figure out where my poly vertices are. I'm thinking of (trying) to write a simple app that allows me to draw a poly on an image and get the vertex coordinates based on [0,0] at the center of the image, but I'd rather not waste the time if a nice way already exists.

So, how do you get your poly coordinates? ;)

EDIT: Maybe I should ask the guys over at the chipmunk forums, duhh :)

Well, nothing useful over at the chipmunk forums.. I've nearly got a solution complete using rmagick.. just have to figure out how I'm going to arrange the verts in a clockwise fashion.
antihcl
 
Posts: 9
Joined: Sat Jun 27, 2009 1:43 pm

Re: How do you get your poly coordinates for Chipmunk?

Postby antihcl » Tue Jul 07, 2009 5:19 pm

Okay! This *appears* to work, but there are no guarantees, since I haven't figured out how to make Chipmunk's collision polys visible. Anyone want to check it out? :)
Attachments
convex_hull_ruby.zip
(1.88 KiB) Downloaded 164 times
antihcl
 
Posts: 9
Joined: Sat Jun 27, 2009 1:43 pm

Re: How do you get your poly coordinates for Chipmunk?

Postby shawn42 » Tue Jul 07, 2009 7:09 pm

I think you can get the bounding box of the shape. That won't be perfect, but should get you in the ball park of whether your verts are being used.
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron