Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on How to proportionally convert a number in the range of -1 and 1 to a number in the range of 0 and 319
Post
How to proportionally convert a number in the range of -1 and 1 to a number in the range of 0 and 319
+3
−2
I have float noise values, between -1 and 1, for every x,y coordinate in a 2D area and I am trying to convert that to a whole number between 0 and 319 which represents a vertical z coordinate to render.
For example,
-1 = 0 and
1 = 319 but
0.12345 = ???
How would I go about implementing this efficiently?
2 comment threads