예제 #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.intersectOp(a, b));
    }
예제 #2
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));
    }
예제 #3
0
    static Result scene(float x, float y)
    {
        Result r1 = new Result(SDFMethods.circleSDF(x, y, 0.3f, 0.3f, 0.10f), 2.0f);
        Result r2 = new Result(SDFMethods.circleSDF(x, y, 0.3f, 0.7f, 0.05f), 0.8f);
        Result r3 = new Result(SDFMethods.circleSDF(x, y, 0.7f, 0.5f, 0.10f), 0.0f);

        return(SDFMethods.unionOp(SDFMethods.unionOp(r1, r2), r3));
    }
예제 #4
0
    static Result scene(float x, float y)
    {
        Result a = new Result(SDFMethods.circleSDF(x, y, 0.4f, 0.2f, 0.1f), 2.0f);
        Result b = new Result(SDFMethods.boxSDF(x, y, 0.5f, 0.8f, SDFMethods.TWO_PI / 16.0f, 0.1f, 0.1f), 0.0f);
        Result c = new Result(SDFMethods.boxSDF(x, y, 0.8f, 0.5f, SDFMethods.TWO_PI / 16.0f, 0.1f, 0.1f), 0.0f);

        return(SDFMethods.unionOp(SDFMethods.unionOp(a, b), c));
    }
예제 #5
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);
    }
    private static Result defaultScene(float x, float y)
    {
        Result a = new Result(SDFMethods.circleSDF(x, y, 0.5f, 0.5f, 0.10f), 1.0f);

        return(a);
    }