Hacker News new | ask | show | jobs
by encypruon 1987 days ago
The author writes:

  The second issue is that solving an overdetermined linear least squares problem is much more expensive than taking a few floating point reciprocals, and is also more prone to blowing up unexpectedly when you run out of precision.  There is some discussion in the paper about how to manage these issues, but it can become very tricky.  As a result, I did not get around to implementng this method in javascript (maybe later, once I find a good linear least squares solver…)
While writing an (honestly probably not very good) implementation in Lua I was facing the same problem. If I understand it correctly the problem is to figure out where to put the vertices so that they end up close to the planes defined by the positions and normals of the neighbouring hermites. I found that I can get a good-enough-for-my-purposes approximation in about 20 lines:

  initialize point at center
  for i = 1, 8 do
      project point onto each plane
      point := average of projected points
      constrain point to reasonable range
  end
Here a some results (some meshed noise):

https://i.imgur.com/utCcKYx.mp4