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

Author Topic: Coordinates system  (Read 4630 times)

0 Members and 1 Guest are viewing this topic.

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
Coordinates system
« on: August 07, 2012, 05:57:44 pm »
Hello, I'm using box2d with sfml and they have different coord system. In SFML Y is directed updown, and in Box2D downup. Any ways to change SFML's  one to box2d's?
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Coordinates system
« Reply #1 on: August 07, 2012, 06:24:08 pm »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
Re: Coordinates system
« Reply #2 on: August 08, 2012, 03:38:13 pm »
Thanks ;)
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Coordinates system
« Reply #3 on: August 08, 2012, 04:34:49 pm »
Can I ask why 'y axis pointing up x axis pointing right' coordinates system has such cult following with anyone who wants to use box2d?
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Coordinates system
« Reply #4 on: August 08, 2012, 05:02:00 pm »
Can I ask why 'y axis pointing up x axis pointing right' coordinates system has such cult following with anyone who wants to use box2d?
What's your question exactly? Box2D defines it's initial coordinate system as y axis up and x axis right, as it's used in most of all cases in mathematics and physics.
SFML uses a y axis down and x axis right coordinate system, because images are defined that way (top-left point = (0,0)).

Those are all formalities and design decisions, it's easily possible to convert from one to another system.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Coordinates system
« Reply #5 on: August 08, 2012, 06:34:47 pm »
I'm asking if there is something that makes system with y pointing up such loved system to the point where people want sfml to change to it: other multimedia library? some rad tool?(im sure borland's vcl has y poiting down)  gamemaker language?
I didn't know box2d defines a coordinates system, where does it do it?
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Coordinates system
« Reply #6 on: August 08, 2012, 07:00:42 pm »
I'm asking if there is something that makes system with y pointing up such loved system to the point where people want sfml to change to it: other multimedia library? some rad tool?(im sure borland's vcl has y poiting down)  gamemaker language?
Who said that they love this orientation so much? Whenever I've seen it requested it was because of Box2D which is a physic engine and like a stated physics mostly always use a y up x right coordinate system.

I didn't know box2d defines a coordinates system, where does it do it?
It's mostly because of the sign of gravity, which gives the impression of down and up, in physics one has defined that force to be negative. If you now use a negative gravity and match the coordinates from Box2D to SFML all objects that are falling down, will get drawn as falling up.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything