20,000 particles + bullet in real time

Official forum for the Chipmunk2D Physics Library.
ShaneR
Posts: 1
Joined: Mon Feb 23, 2009 12:59 am
Contact:

Re: 20,000 particles + bullet in real time

Post by ShaneR »

How did you get the generate the co-ordinates for the logo in the LogoSmash.c demo? I am on mac also. The ones sitting in

static const unsigned char image_bitmap[] = {

I've kinda reverse engineered how it works. But I am too daft to figure out how to turn a bitmap into a set of appropriate co-ordinates.

Thanks,

Shane
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: 20,000 particles + bullet in real time

Post by slembcke »

I converted the image into a bitmap and stuck the raw bits into a C array. (combination of GraphicConverter and a Ruby script) Then I iterate the bitmap and and a particle for every bit that is set in the bitmap.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
ker
Posts: 56
Joined: Tue Jul 15, 2008 4:13 am
Contact:

Re: 20,000 particles + bullet in real time

Post by ker »

gimp can safe images as c-files (it will fill it with code that creates that array).

I think it's sufficient to simply use "save as" and use "something.c" as the filename. Gimp will automatically select the c-exporter
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests