I am trying to read a coloured heightmap specifically there one found here into a set of coordinates for use in a triangle mesh. The problem is I don't know how to exactly convert the Argb values to a height scale from 0-255. Thanks in advance!
Asked
Active
Viewed 111 times
1 Answers
0
Dind't know you exactly implementation but... I think you can get an idea from this:
rgb = 65536 * r + 256 * g + b;
Hope it helps.

J. Lorenzo
- 151
- 1
- 7
-
The thing is I need to convert it to a single digit instead of the rgb components so that I can use them as coordinates. Thanks for the answer! – Politic Revolutionnaire Mar 18 '18 at 04:42
-
Maybe you need this: rgb = 65536 * r + 256 * g + b; It's a little bit tricky. – J. Lorenzo Mar 18 '18 at 04:47
-
So with the new answer, would I have to combine it with the numbers that you posted before in order to get it within the min-max range I need? – Politic Revolutionnaire Mar 18 '18 at 17:36