Sign in to follow this  

arranging the hud degrees

This topic is 3665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi there guys this may be a simple problem some of you have done before i am trying to get the angles correct for my hud, it is just a round dial with a needle that shows the speed i am going , the speed is calculated from a 0 - 1 range the initial 0 position is 178 degrees the end 1 position is 110 degrees so there is a 68 degree difference from start to end. how can a work out the current angle needed if say fuel was 0.5?

Share this post


Link to post
Share on other sites
Linear interpolation: w = u + (1 - t) * (v - u)
where
w = the angle representing the current speed
u = the angle representing the minimum speed
v = the angle representing the maximum speed
t = the current speed on a normalized 0 - 1 scale

So for a [178, 110] angular range and a current speed of 0.5:
w = 178 + (1 - 0.5) * (110 - 178)
= 178 + 0.5 * -68
= 178 - 34
= 144

Share this post


Link to post
Share on other sites

This topic is 3665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this