flash to iphone

in flash we use this dbgDraw.m_sprite = m_sprite; how you replaced this
and then we can control camera as m_sprite will do the job

now how to put this in cocos2d box2d . ??
so that i can control the world
Basically, you can do it the same way in cocos2d; simply put your debug draw in a CCLayer and move that layer around to simulate the camera.

Drawing debug data in the layer is simple, you just need to override the -draw method in the layer like so:
Code:
- (void) draw
{
   [super draw];
   glEnableClientState(GL_VERTEX_ARRAY);
   world->DrawDebugData();
   glDisableClientState(GL_VERTEX_ARRAY);
}

Then call -setPosition: on the layer to move it around.

Another approach would be to use CCCamera instead of moving the actual layer.
can you post some code ??
i did CCCamera but those SetEye was above my head 🙁
This should work:
Code:
[self.camera setCenterX:camX centerY:camY centerZ:0];
[self.camera setEyeX:camX eyeY:camY eyeZ:415];

camX and camY are floats containing X and Y coordinates of the camera. Put the code in your -tick: method and change the camX and camY values to pan the camera.

I'm not very familiar with OpenGL, but from what I understand the cocos2d camera is basically a wrapper for gluLookAt(). This page explains what the various attributes in gluLookAt are used for: http://pyopengl.sourceforge.net/documen ... At.3G.html

Original thread: https://box2d.org/forum/viewtopic.php?t=4308