Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6146533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:57:48+00:00 2026-05-23T18:57:48+00:00

Hey i’m trying to integrate SFML and Box2D, and SFML has made setting centers

  • 0

Hey i’m trying to integrate SFML and Box2D, and SFML has made setting centers for sprites, shapes, etc. very easy. Box2D, on the other hand, I’m having trouble with as i can’t figure out how to set or even find the center of a shape or fixture.

It seems to me that when adding vertices manually to a b2_PolygonShape the center is set to the first vertex in the vertex array, but the results are very different when using the shortcut functions SetAsBox() or any other SetAs__(). The Center is the middle of the shape, or half extent(s) of the box/shape.

I need to commonize box2D’s and SFML’s centering system, but i can’t figure out how the local coordinate systems work for objects.

How do I set/get the centers of the many objects such as shapes, fixtures, bodies, etc. in Box2D?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:57:48+00:00Added an answer on May 23, 2026 at 6:57 pm

    Ok I realized that SFML and Box2D really weren’t all that different, but i just wasn’t thinking about how shapes are made/ rendered correctly in world coordinates.

    Unless otherwise specified, (0,0) is always used as the refrence point/ center of the object when its position is being moved around/ drawn, and each vertex is drawn in relation to that point.

    the SFML tutorial was a bit confusing as it said setting the center of a shape/sprite was the offset from the top left corner of the object, not (0,0).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I am new to PHp and I am trying to enter details into
Hey, I'm trying to create Like Buttons for Facebook Photos, but can't figure out
Hey I've had nonstop problems with SQL. I'm trying to get some experience because
Hey all i have an XML file that i am trying to loop though.
Hey guys, am trying to write to do type casting in java, but i
hey i got a contnet type that i made and i want to twweak
Hey, I'm trying to get the source code of an app similar to the
Hey I'm trying to creare a link that passes the link's text directly to
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey, in the Programming Pearls book, there is a source code for setting, clearing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.