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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:45:33+00:00 2026-05-16T06:45:33+00:00

I am trying to do a rotation of a game object by setting a

  • 0

I am trying to do a rotation of a game object by setting a start and end point and X frames to do the movement. Then interpolate start and end angle to get it done.

It works well, but I am trying to do the shortest possible route as an option (as opposed to “do the longest route”).
In most cases it works, but if the rotation goes above 360 or below 0, I don’t know how to detect it and alter the numbers. (for example if I want to take the shortest route from 270 to 90, the shortest route goes above 360/0, so is never used, so 270 should become -45 to interpolate to 90).
I am terrible at explaining and I am not native English to round it up, so I will use pseudocode of what I have.

 thing.start_angle = 180
 thing.end_angle = 90
 thing.angle = interpolate(thing.start_angle, thing.end_angle, position)

I like this way (for the detailed time control over a “if angle > max_angle then angle – 1”), but I can’t find a “rule” for how to detect if the angle will rotate…
How can I find if the rotation will go below 0 or above 360, to act accordingly?

  • 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-16T06:45:34+00:00Added an answer on May 16, 2026 at 6:45 am

    The angle will wrap if

    thing.end_angle – thing.start_angle >= 180 or < -180

    (assuming an angle range of 0 to 379).

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

Sidebar

Related Questions

I´m trying to get the right landscape Rotation. What I have done until now:
I am trying to ease (gradually move) the rotation of an object to an
I'm trying to get an element to animate a rotation hover effect using jquery,
I am trying to honor the android rotation lock setting - I want my
I'm trying to achieve an object rotation about 3 axes by incrementing values of
I'm trying to do a simple rotation in OpenGL but must be missing the
I am trying to disable log rotation, for file handler using, FileHandler fh =
trying to get some data from a plist into the MWPhotoBrowser sample app. Any
Trying to get my css / C# functions to look like this: body {
I've got weird problem. I'm trying to write simple game in C++, but I

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.