Skip to main content
8 events
when toggle format what by license comment
Feb 9, 2012 at 4:14 comment added Nathan Reed I added code for interpolating along X. Changing it to interpolate along Z is left as an exercise for the reader. ;)
Feb 9, 2012 at 4:13 history edited Nathan Reed CC BY-SA 3.0
added example code
Feb 7, 2012 at 0:23 comment added Felix K. Hmm but it's a heightmap with fixed points, so 3D interpolation does not makes any sense to me. ;-) Anyway i gonna test it tomorrow, if it's right and you updated your answer the credits belong to you.
Feb 7, 2012 at 0:18 comment added Nathan Reed Right. You'd do the interpolation in 3D, at least that's what makes sense to me. You could project it down to 2D by throwing out one of the coordinates - for the X-tangent, throw out the Z value, and vice versa. If you need a slope instead of a tangent, divide: Y/X for the X-tangent, Y/Z for the Z-tangent.
Feb 6, 2012 at 23:40 comment added Felix K. But then i still have a 3D coordinate, not a single float. :-/
Feb 6, 2012 at 23:02 comment added Nathan Reed Oh. You just rotate it 90 degrees. I guess you're using a Y-up coordinate system, so take the normal and rotate by -90 around Z to get the X-tangent, and by 90 around X to get the Z-tangent.
Feb 6, 2012 at 22:26 comment added Felix K. Thanks for the suggestion, but my main problem is still how to get the tangent from the 3D-normal.
Feb 6, 2012 at 22:16 history answered Nathan Reed CC BY-SA 3.0