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 7567563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:41:42+00:00 2026-05-30T14:41:42+00:00

I have a simply Box2d body with a triangular polygon shape and I’m trying

  • 0

I have a simply Box2d body with a triangular polygon shape and I’m trying to rotate the body. The code below appears to work; I’ve checked the body angle before and after and it has changed as I expect.

body.setTransform(body.getPosition(), body.getAngle()+TURN_ANGLE);

The problem is when I draw the polygon the vertices remain unchanged. Is this how it should be? I did wonder whether I need to apply a transform to the vertices but can’t find a way to do it.

Any pointers would be very much appreciated.

  • 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-30T14:41:44+00:00Added an answer on May 30, 2026 at 2:41 pm

    Originally my drawing method did something like this:

        PolygonShape src = (PolygonShape) f.getShape();
    
        for (int i = 0; i < src.getVertexCount(); ++i)
        {
          Vec2 srcPt = src.getVertex(i);
    
          // build polygon up of these points and draw ...
    

    I’ve managed to get it working now by changing the code above to this:

        PolygonShape src = (PolygonShape) f.getShape();
    
        Transform t = new Transform();
        t.set(new Vec2(0,0), body.getAngle());
    
        for (int i = 0; i < src.getVertexCount(); ++i)
        {
          Vec2 srcPt = Transform.mul(t, src.getVertex(i));
    
          // build polygon up of these points and draw ...
    

    Seems to work as expected.

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

Sidebar

Related Questions

In the code below I have simply used a mouse listener to get the
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
In WPF 3.5 (with SP1), I have simply StackPanel that I would like to
First of all, excuse my poor topic title. I simply have no idea how
I have a @variabletable simply defined as EOMDate(datetime), DandA(float), Coupon(float), EarnedIncome(float) 04/30/2008, 20187.5,17812.5,NULL 05/31/2008,
I have a very simply subclass of UIButton that will fire off a custom
What are the technical questions I simply must have answers for before I approach
Very simply put: I have a class that consists mostly of static public members,
I have a windows form simply like this: 1) a button when clicked will
We have a junior programmer that simply doesn't write enough tests. I have to

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.