[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Coordinate space on iphone (Demo)

Coordinate space on iphone (Demo)

Official forum for the .

Coordinate space on iphone (Demo)

Postby chess77 » Fri Feb 20, 2009 11:38 am

Hi,

I am looking at the demos on the iPhone (downloaded with cocos2d), and I wonder why the world seems to be defined from -320 to 320 and -480 to 480, while the device is 320 * 480 only. Is there anything that should prevent me from using 0-320 and 0-480? Maybe the demo code is from another platform where this made more sense?

Thanks,
Eiko

PS: I think it would be useful to have the version number somewhere in the source files, as I can only guess if cocos2d has the newest things included. Well, I am currently using nothing but the physics engine. :)
chess77
 
Posts: 2
Joined: Wed Aug 06, 2008 2:01 pm

Re: Coordinate space on iphone (Demo)

Postby slembcke » Fri Feb 20, 2009 2:02 pm

I've never actually used Cocos2d, but I assume that they are just using the demo code from the GLUT demos which use a 640x480 window.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Coordinate space on iphone (Demo)

Postby chess77 » Fri Feb 20, 2009 6:59 pm

Thanks, that makes sense!
chess77
 
Posts: 2
Joined: Wed Aug 06, 2008 2:01 pm

Re: Coordinate space on iphone (Demo)

Postby wildstar » Fri Feb 20, 2009 7:00 pm

Hey chess77,
I'm also using Cocos2d with Chipmunk. slembcke's right in that they've just grabbed the demo code without modification of the simulation space. When setting up your cpSpace, you can just specify the min width and height to be 0 and the max to be 480x320 (or 320x480 if you're running landscape.) Alternatively you could position the origin at the center of the display and then do conversions between physics space and cocos space. Personally I find matching the physics space up to the display space to be helpful. The chipmunk_accel demo in Cocos2d uses a Chipmunk coordinate space that is aligned with Cocos.
wildstar
 
Posts: 4
Joined: Sun Feb 15, 2009 7:09 pm

Re: Coordinate space on iphone (Demo)

Postby Toolism » Wed May 20, 2009 9:58 pm

Can anyone clarify how you can change the width and height of cpSpace? All I can see in the documentation is cpSpaceNew() and after having a good look through the headers I havent found anything that would resemble width or height. This information would help me greatly as I am too using cocos2d and would like my cpSpace to be from 320X480.
Toolism
 
Posts: 2
Joined: Wed May 20, 2009 9:55 pm

Re: Coordinate space on iphone (Demo)

Postby slembcke » Thu May 21, 2009 1:25 am

Chipmunk spaces don't have a width or height. Objects can be placed anywhere within them.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Coordinate space on iphone (Demo)

Postby Toolism » Thu May 21, 2009 4:53 am

Thanks for the clarification. Doesn't that mean that this whole topic is kind of wrong?:)
Toolism
 
Posts: 2
Joined: Wed May 20, 2009 9:55 pm

Re: Coordinate space on iphone (Demo)

Postby slembcke » Thu May 21, 2009 11:49 am

No, the original topic was asking about how big the OpenGL viewport was that was used to draw things in the Chipmunk demos that come with Cocos2D.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 0 guests