I want to preface by saying that I am not great at linear algebra and really only know the basics. I am trying to map a 3D line (given as latitude and longitude) to a height map of the corresponding region the LLA line comes from with three.js. I read over this post here, and think I get the idea behind LLA to ECEF conversion, the problem I am running into is taking the ECEF vectors and mapping them to Euclidean space to match up with the height map.
Ex.
Here is the height map in Euclidean space, the vertical pink line is 1 unit away from the origin
Using the function from the linked thread, I am able to convert a LLA pair to a vector:
LLA: [39.5990128, -106.5210928] => ECEF: [2061284.281976205, 20613.52994200761,-6035835.798133525] => ??? Line up with the height map, but in Euclidean space? ???
I used tangrams to obtain the height map, which gives you the LLA of the center of the screen. I am sure this has to be factored into how the mapping takes place, but I am unsure on where to even start. So far I have just been playing with the scale values in the renderer to try to match the two.
Is there more data I need to perform this mapping (i.e. the LLA bound of the height map)? What is this operation known as specifically besides "mapping"? What is the right place to start to solve this problem?