Koval's 3D Grapher v 5.0
Plot evaluation function:
Toggle plot pause/resume hotkey: alt-p
Will this crash my computer?
Color evaluation function
Plot evaluation function:
// A point p lies in the plotted set if evaluate(p) = 0.
// You write the evaluate function!
// This is GLSL v330. For basic usage, see https://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations
float evaluate(vec3 p){
float x = p.x;
float y = p.y;
float z = p.z;
return 0.8 - length(p) -1.0 + abs(p.x) + abs(p.y) + abs(p.z);
}
Will this crash my computer?
Color evaluation function
vec3 getColor(vec3 p, vec3 inDir){
// the width of a voxel
float eps = 0.002;
bool insideSurface = evaluate(p - eps * inDir) < 0.0;
if(insideSurface){
// yellow
return vec3(1.0, 0.9725, 0.4314);
} else {
// white
return vec3(1.0, 1.0, 1.0);
}
}
Waiting...