円筒

最終更新日09 Feb 2017 02:40

float sdCylinder(vec3 p, vec2 h)
{
    vec2 d = abs(vec2(length(p.xz),p.y)) - h;
    return min(max(d.x,d.y),0.0) + length(max(d,0.0));
}

from
Bibliography

サポートサイト Wikidot.com