Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Need help with scaling Box2D coords  (Read 2417 times)

0 Members and 1 Guest are viewing this topic.

Dark Byte

  • Newbie
  • *
  • Posts: 30
    • View Profile
Need help with scaling Box2D coords
« on: July 02, 2011, 03:51:40 pm »
Hi, I cannot convert the Box2D coords to pixels. Everything I have tried does the same just on a different scale. Does anyone know how to convert them?

Dark Byte

  • Newbie
  • *
  • Posts: 30
    • View Profile
Need help with scaling Box2D coords
« Reply #1 on: July 02, 2011, 07:34:12 pm »
Nvm it is fixed  :)

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Need help with scaling Box2D coords
« Reply #2 on: July 02, 2011, 07:36:09 pm »
Screen Width / Meters Width = DeltaX
DeltaX * Box2D Coords

Screen Height / Meters Height = DeltaY
DeltaY * Box2D Coords

Not sure if this is what you're asking for, but I recommend keeping it in meters because using pixels with Box2D can mess stuff up, unless of course you know what you're doing.

Edit: Oh, you beat me too it...
Need a place to upload your code, files or screenshots? Use SFML Uploads!