Content deleted Content added
Line 30:
== Signed Distance Noise ==
The vector field is created based on a closed and differentiable implicit surface '''S = F'''(x,y,z) = 0. For every point in the space, frecuently outside or near the surface, we get a vector '''g''' that is normal to the surface, this is the gradient of S or the partial derivatives respect to x, y and z, this vector is not unitary but we can get a unitary normal '''n''' by dividing each component of the point by the
<math>
Outside of the surface all these normals point away from the surface. Afterwards we calculate a scalar value p for that point in the space using a 3D perlin or simplex noise function. Now we create a vector field '''F''' = p'''n''' pointing outside of the surface. Then the curl of this vector field gives the direction in every point in the space where the particles should move. By construction this vector F will point in a tangent direction to a isosurface at the level of the signed distance to the original surface and can be used to confine the movements of the particles to stay in that surface.▼
g=\nabla F(x, y, z) = \left(\frac{\partial F}{\partial x}, \frac{\partial F}{\partial y}, \frac{\partial F}{\partial z}\right)</math>
<math>
\mathbf{n} = \frac{g(x, y, z)}{\|\nabla F(x, y, z)\|}
</math>
<math>
\|\nabla F(x, y, z)\| = \sqrt{\left(\frac{\partial F}{\partial x}\right)^2 + \left(\frac{\partial F}{\partial y}\right)^2 + \left(\frac{\partial F}{\partial z}\right)^2}
</math>
▲
<math>SDN = (\frac{\partial Fz}{\partial y} - \frac{\partial Fy}{\partial z} ,\frac{\partial Fx}{\partial z} - \frac{\partial Fz}{\partial x},\frac{\partial Fy}{\partial x} - \frac{\partial Fx}{\partial y})</math>
By construction this vector SDN will point in a tangent direction to a isosurface at the level of the signed distance to the original surface and can be used to confine the movements of the particles to stay in that surface.
|