Examples on scalar distance field or directed distance field?

237 Views Asked by At

I come across the scalar distance field and directed distance field in this paper Feature Sensitive Surface Extraction from Volume Data.

What is the difference and can anyone provide an example. Thanks a lot.

1

There are 1 best solutions below

2
On

from http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm

I figured it out...

directed distance will be

If a Sphere is defined as follow

float sdSphere( vec3 p, float s )
{
    return length(p)-s;
}

Given any point

vec3 a

in the space, The directed distance will has direction

a - p

with signed distance

sdSphere(a, s)

scalar distance will be

Sphere - signed - exact

float sdSphere( vec3 p, float s )
{
    return length(p)-s;
}

Sphere - unsigned - exact

float sdSphere( vec3 p, float s )
{
  return abs(length(p)-s);
}