예제 #1
0
    static Result scene(float x, float y)
    {
        Result a = new Result(SDFMethods.circleSDF(x, y, 0.4f, 0.5f, 0.20f), 1.0f);
        Result b = new Result(SDFMethods.circleSDF(x, y, 0.6f, 0.5f, 0.20f), 0.8f);

        return(SDFMethods.subtractOp(b, a));
    }
예제 #2
0
    static Result scene(float x, float y)
    {
        Result a = new Result(SDFMethods.circleSDF(x, y, 0.4f, 0.2f, 0.1f), 2.0f, 0.0f);
        Result d = new Result(SDFMethods.planeSDF(x, y, 0.0f, -1.0f, 0.5f), 0.0f, 0.9f);
        Result e = new Result(SDFMethods.circleSDF(x, y, 0.5f, 0.5f, 0.4f), 0.0f, 0.9f);

        return(SDFMethods.unionOp(a, SDFMethods.subtractOp(d, e)));

        //Result a = new Result(SDFMethods.circleSDF(x, y, 0.4f, 0.2f, 0.1f), 2.0f, 0.0f);
        //Result b = new Result(SDFMethods.boxSDF(x, y, 0.5f, 0.8f, SDFMethods.TWO_PI / 16.0f, 0.1f, 0.1f), 0.0f, 0.9f);
        //Result c = new Result(SDFMethods.boxSDF(x, y, 0.8f, 0.5f, SDFMethods.TWO_PI / 16.0f, 0.1f, 0.1f), 0.0f, 0.9f);
        //return SDFMethods.unionOp(SDFMethods.unionOp(a, b), c);
    }