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

Author Topic: setOrigin( ), good or bad?  (Read 1331 times)

0 Members and 1 Guest are viewing this topic.

Snizzlenose

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
setOrigin( ), good or bad?
« on: May 30, 2015, 06:38:58 pm »
Should you keep the origin as it is in the top left corner or change it to say center mass of your sprite / shape? 
I assume this depends on preference, but does it come with implications further on?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: setOrigin( ), good or bad?
« Reply #1 on: May 30, 2015, 06:51:47 pm »
It doesn't matter. Do whatever is easier.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: setOrigin( ), good or bad?
« Reply #2 on: May 31, 2015, 11:17:06 am »
but does it come with implications further on?
Yes. The origin is not only the reference point for translation, but also for rotation and scale. If you need those transforms, you usually want the origin to be the object's center.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: