I saw this How can I Compute steepness for heightmap while looking for a way to reflect pixels. But now that I have the steepness/slope I don't know how to calculate which angle it's pointing at. Imagine if I had an image parallel (directly above my heightmap) with my heightmap and 100(units/pixels) away/above from it, if the steepness is 0, then i just grab a pixel at that same [x,y]. Imagine that i am trying reflect what the heightmap would show if i was to be able to see through my image.
But let's say I have a steepness of 1 which i am guessing is 45 degrees since 1/1 is 45 degrees but which pixel should i be grabbing from my image how do I calculate what angle the pixel is coming from [x,y].
How would i calculate which pixel(location) is reflected onto the heightmap (imagining that the heightmap is a chrome surface).
I know if the angle is too steep it'll be way outside of the image but I'll just use min/max hack to grab border pixels (unless you can think of another method to handle that) but for angles that are inside my image still...how do I calculate which pixels to reflect.
Basically trying to render an image reflected by height-map when image is placed directly above heightmap with variable input of distance between image and heightmap (use like 100 units as example, but i want to allow user the ability to change this distand)
Please explain in easy terms as sometimes I don't understand rare mathematics notation/symbols.
Thanks in advance.
EDIT: This got me searching for calculating normal for heightmap I think I found what I was looking for.