title: PTM_RATIO in retina display using Box2D, cocos2d and Physics Editor
body: <p>I’m having a lot of problems trying to draw body shapes on my sprites. I tried a lot of combinations but I’m not able to make it work on retina display.</p>
  
  <p>I’m supporting iPhone retina only and both iPad (retina and not retina). </p>
  
  <p>A. PTM_RATIO</p>
  
  <p>The first question is which PTM_RATIO use for each device if I want the same physics in all devices. I read several posts and I don’t know if PTM stands for “<strong>Point To Meter</strong>” or “<strong>Pixel To Meter</strong>”.</p>
  
  <p><img src="https://i.stack.imgur.com/2uzi5.png" alt="enter image description here"></p>
  
  <p>¿Which column is the right one?</p>
  
  <p>B. Physics</p>
  
  <p>I want do draw a ground using different images of different shapes, but for this purpose I’m using two of the simplest type. An image of 200x200px but the body only takes the lower 200x80px rectangle.</p>
  
  <p><img src="https://i.stack.imgur.com/RFpyt.png" alt="enter image description here"></p>
  
  <p>To keep the sprite aspect I use 200x200px art for iPhone and iPad SD and 400x400 for iPad HD. Then I try to define a body for the red area. I tried all possible combinations using Physcs Editor and I tried to do it manually also with Vertex Helper. I made it work for iPad SD but not for retina display (always x2).</p>
  
  <p>My verts:</p>
  
  <pre><code>int num = 4;
          b2Vec2 verts[] =
          {
              b2Vec2(-100.0f / 100.0, -20.0f / 100.0),    //A
              b2Vec2(100.0f / 100.0, -20.0f / 100.0), //B
              b2Vec2(100.0f / 100.0, -100.0f / 100.0),    //C
              b2Vec2(-100.0f / 100.0, -100.0f / 100.0),   //D
          };
  </code></pre>
  
  <p>I divided by 100 because I used the 200x200 art. I tried to divide by PTM_RATIO and by PTM_RATIO * CC_CONTENT_SCALE_FACTOR() without useful results. I tried to do it with the 400x400 art… I think I tried all the possible combinations.</p>
  
  <p>For debugging purposes I’m using GLES-Render class provided with cocos2d+Box2d template.</p>
  
  <p>The draw method in my layer:</p>
  
  <pre><code>- (void) draw
  {
      [super draw];
      ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
      kmGLPushMatrix();
      world-&gt;DrawDebugData();
      kmGLPopMatrix();
  }
  </code></pre>
  
  <p>Should I use?:</p>
  
  <pre><code> glScalef(CC_CONTENT_SCALE_FACTOR(), CC_CONTENT_SCALE_FACTOR(), 1);
  </code></pre>
  
  <p>I feel really stuck.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Pysics Editor combinations and results:</p>
  
  <p><img src="https://i.stack.imgur.com/rctzb.png" alt="Physcs Editor results"></p>
  
  <p>Macro definition:
  50 PTM_RATIO for iPhone and 100 PTM_RATIO for iPad 2 and iPad 3.</p>