Drawing shapes

Official forum for the Chipmunk Physics Library.

Drawing shapes

Postby zaldzbugz on Wed Feb 03, 2010 3:36 am

Hi,

Do you have an idea how to draw shapes?

For example i have Added a SHAPE to a BODY and SHAPE->DATA has no image and i want that instead of an Image shape, i will place a simple colored shape with border like the Chipmunk demo sample where the shapes has colors.

I'll be needing this for development so that even though the images that i need was being created, i could visualize the shapes and distinguish each shape based on each colors.

Regards,
ZaldzBugz
"A man of tomorrow is forged by his battles today."
User avatar
zaldzbugz
 
Posts: 38
Joined: Tue Jan 19, 2010 2:45 am

Re: Drawing shapes

Postby slembcke on Wed Feb 03, 2010 11:12 am

What are your criteria for coloring them? You could probably just make some trivial modifications of the Chipmunk debug drawing code. The debug drawing code uses the shape pointer to generate a consistent but random color. If you can get to the color you want from the shape pointer (or the body pointer from there) then it would be easy.
I'm the guy that wrote Chipmunk. Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 1485
Joined: Tue Aug 14, 2007 7:13 pm

Re: Drawing shapes

Postby zaldzbugz on Wed Feb 03, 2010 11:19 pm

hi, where can i find the debug drawing code? random color is fine with as long as the shape will contain plain colors.
"A man of tomorrow is forged by his battles today."
User avatar
zaldzbugz
 
Posts: 38
Joined: Tue Jan 19, 2010 2:45 am

Re: Drawing shapes

Postby Tam Toucan on Thu Feb 04, 2010 1:22 am

It's in the Demo directory, drawSpace.c (you should have a look at all the Demo source files. They are good examples of how to use Chipmunk)
User avatar
Tam Toucan
 
Posts: 138
Joined: Tue Jun 23, 2009 4:26 pm

Re: Drawing shapes

Postby zaldzbugz on Fri Feb 26, 2010 4:06 am

thanks tam
"A man of tomorrow is forged by his battles today."
User avatar
zaldzbugz
 
Posts: 38
Joined: Tue Jan 19, 2010 2:45 am


Return to Chipmunk Physics

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron