scaling system in Box2d

Hi,

can any one explain it deeply about the pixels and meters. Then about scaling system as i'm new to Box2d.
Then how my objects should be scaled?


"scaling system": Scale down the graphics and at the same time zoom in with the camera. Is it correct? If so how can i do it.
I wrote a blog post about this: http://box2d.org/2011/12/pixels/
Erin Catto wrote:
I wrote a blog post about this: http://box2d.org/2011/12/pixels/


Hello,

What must be done to use the Box2D testbed examples in screen-pixel coordinates?

I'm creating my own testbed example.

I would like to place my world bodies in pixel coordinates, and I would also like
to draw OpenGL elements, using DrawPoint, DrawSegment, etc... in screen-pixel coordinates too.
gerald wrote:
Erin Catto wrote:
I wrote a blog post about this: http://box2d.org/2011/12/pixels/


Hello,

What must be done to use the Box2D testbed examples in screen-pixel coordinates?

I'm creating my own testbed example.

I would like to place my world bodies in pixel coordinates, and I would also like
to draw OpenGL elements, using DrawPoint, DrawSegment, etc... in screen-pixel coordinates too.


Google "openGL 2D camera". You will probably need a camera class of some sort. From there you can use the position/rotation/scale of your camera in the world to convert points on screen space to world space.

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