Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

bending #206

Open
krober10nd opened this issue Mar 12, 2021 · 0 comments
Open

bending #206

krober10nd opened this issue Mar 12, 2021 · 0 comments

Comments

@krober10nd
Copy link
Owner

  • bending of geometric primitives via

float opCheapBend( in sdf3d primitive, in vec3 p )
{
    const float k = 10.0; // or some other amount
    float c = cos(k*p.x);
    float s = sin(k*p.x);
    mat2  m = mat2(c,-s,s,c);
    vec3  q = vec3(m*p.xy,p.z);
    return primitive(q);
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant