Exemplo n.º 1
0
        public override void Compile(ref string frag, int iteration)
        {
            Matrix3 preRot = new Matrix3();

            preRot.MakeFromRPY(_PreRotation.x, _PreRotation.y, _PreRotation.z);
            Matrix3 postRot = new Matrix3();

            postRot.MakeFromRPY(_PostRotation.x, _PostRotation.y, _PostRotation.z);
            switch (_FractalType)
            {
            case EFractalType.Cube:
                frag += "Cuboid(pos, origPos, scale, fracScale" + iteration + ", fracOffset" + iteration + ", fracPreRot" + iteration + ", fracPostRot" + iteration + @");
            DEMode = 0;";
                break;

            case EFractalType.Menger:
                frag += "Menger(pos, origPos, scale, fracScale" + iteration + ", fracOffset" + iteration + ", fracPreRot" + iteration + ", fracPostRot" + iteration + @");
            DEMode = 0;";
                break;

            case EFractalType.Tetra:
                frag += "Tetra(pos, origPos, scale, fracScale" + iteration + ", fracOffset" + iteration + ", fracPreRot" + iteration + ", fracPostRot" + iteration + @");
            DEMode = 0;";
                break;
            }
        }
Exemplo n.º 2
0
        public override void Compile(ref string frag, int iteration)
        {
            Matrix3 rot = new Matrix3();

            rot.MakeFromRPY(_Rotation.x, _Rotation.y, _Rotation.z);
            frag += "Box(pos, origPos, scale, fracScale" + iteration + ", fracRot" + iteration + ", fracMinRad" + iteration + @");
            DEMode = 1;";
        }
Exemplo n.º 3
0
        public override void SetDeclarations(ref ShaderVariables shaderVars)
        {
            Matrix3 rot = new Matrix3();

            rot.MakeFromRPY(_Rotation.x, _Rotation.y, _Rotation.z);
            mat3 glRot = rot.GetGLMat3();

            shaderVars.Add("fracScale" + _Iteration, _Scale);
            shaderVars.Add("fracRot" + _Iteration, glRot);
            shaderVars.Add("fracMinRad" + _Iteration, (float)_MinRadius);
        }
Exemplo n.º 4
0
        public override void SetDeclarations(ref ShaderVariables shaderVars)
        {
            Matrix3 preRot = new Matrix3();

            preRot.MakeFromRPY(_PreRotation.x, _PreRotation.y, _PreRotation.z);
            mat3    glPreRot = preRot.GetGLMat3();
            Matrix3 postRot  = new Matrix3();

            postRot.MakeFromRPY(_PostRotation.x, _PostRotation.y, _PostRotation.z);
            mat3 glPostRot = postRot.GetGLMat3();

            shaderVars.Add("fracScale" + _Iteration, (float)_Scale);
            shaderVars.Add("fracOffset" + _Iteration, _Offset);
            shaderVars.Add("fracPreRot" + _Iteration, glPreRot);
            shaderVars.Add("fracPostRot" + _Iteration, glPostRot);
        }