How many pixels in a meter? Simple.

Sep 18, 2010 at 3:26 PM

Simple question, how many pixels are there in a meter? If a object was 50m wide, how many pixels would that be exactly?

Thanks, eXsolv3d

Developer
Sep 18, 2010 at 9:34 PM

Simple answer: That depends completely on you.

Look into the Box2D Manual for a more detailed explanation:

http://www.box2d.org/manual.html#_Toc258082967

Chapter 1.7 Units

Basically you have to define, how many pixels a meter has and scale the physics engine output accordingly.

Sep 19, 2010 at 2:00 AM

Thank you sir. So if I understand that correctly, if the majority of my objects are, say.. 100pixels wide, I can use a scale of 1m:100px, thus when creating the fixtures etc, the dimensions for that 100px object will simply be (1,1) in meters?

Sep 19, 2010 at 3:52 AM

Exactly!

Sep 19, 2010 at 5:26 AM

BAM! And the job's done. Cheers lads.