Isosurface.Sampler.Sphere C# (CSharp) Method

Sphere() public static method

public static Sphere ( Vector3 pos ) : float
pos Vector3
return float
        public static float Sphere(Vector3 pos)
        {
            const float radius = (float)Resolution / 2.0f - 2.0f;
            Vector3 origin = new Vector3((Resolution - 2.0f) * 0.5f);
            return (pos - origin).LengthSquared() - radius * radius;
        }

Same methods

Sampler::Sphere ( Vector3 pos, float radius ) : float
Sampler::Sphere ( float x, float y, float z ) : float