Created
February 17, 2015 23:59
-
-
Save paniq/3a8f847fa024448e68c1 to your computer and use it in GitHub Desktop.
Decocube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example for an implicit surface that is not lipschitz continuous | |
float decocube(vec3 p) { | |
float r = (0.8*0.8); | |
float a = ((p.x+p.y)-r); | |
float b = ((p.y+p.z)-r); | |
float c = ((p.z+p.x)-r); | |
vec3 u = (p-1.0); | |
float q = ((a*a)+(u.z*u.z)); | |
float s = ((b*b)+(u.x*u.x)); | |
float t = ((c*c)+(u.y*u.y)); | |
return ((q*s*t)-0.04); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment