How many pixels in a meter? Simple.

Sep 18, 2010 at 2: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

Sep 18, 2010 at 8:34 PM

Simple answer: That depends completely on you.

Look into the Box2D Manual for a more detailed explanation:

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 1: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 2:52 AM


Sep 19, 2010 at 4:26 AM

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