I am a noob and i want to layout vertices for a image
Chipmunk
(4 posts) (2 voices)-
Posted 2 years ago #
-
Chipmunk is a physics engine.
Cocos has a nice setup where it does it for you, just create your image:
> Sprite *myImage = [Sprite spriteWithFile:"spriteName.png"];
and then add it to your CocosNode (like layer) with
> [self addObject:myImage];
If you're set on figuring out how to layout the vertices for an image, I'd suggest an openGL tutorial. A good one is here: http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Entries/2009/4/1_OpenGL_ES_05_-_Texture_Mapping_Our_Square.html
Posted 2 years ago # -
no what i went is i want to layout a polygon shape for a image in chipmunk
Posted 2 years ago # -
I think what you're saying is that you want to make a custom chipmunk cpShape (that just happens to have an image attached to it).
Look at this sample code for defining custom shapes' vertices: http://pastebin.com/f5585f368
Posted 2 years ago #
Reply
You must log in to post.