Пример #1
0
        public override void Execute(ref WooState state)
        {
            if (state._Objects > 0)
            {
                state._Objects--;
                Vector3 val = new Vector3(0.0, 0.5, 0.0);
                val.y *= state._Scale.y;
                val.Mul(state._Rotation);

                Cylinder newCylinder = new Cylinder(new Vector3(state._Position.x + val.x, state._Position.y + val.y, state._Position.z + val.z), state._Scale * 0.5, state._Rotation);
                newCylinder._Material = GenerateMaterial(state);
                newCylinder.CreateElement(state._Preview, state._Parent);
            }
        }
Пример #2
0
        public override void Execute(ref WooState state)
        {
            if (state._Objects > 0)
            {
                state._Objects--;
                Vector3 val = new Vector3(0.0, 0.5, 0.0);
                val.y *= state._Scale.y;
                val.Mul(state._Rotation);
                Vector3 pos = new Vector3(state._Position.x + val.x, state._Position.y + val.y, state._Position.z + val.z);

                SphereLight newLight = new SphereLight(state._Diff,
                    pos,
                    (float)(state._Scale.y * 0.5),
                    2);
                newLight.CreateElement(state._Parent, pos);
            }
        }
Пример #3
0
        public override void Execute(ref WooState state)
        {
            if (state._Objects > 0)
            {
                state._Objects--;
                Vector3 val = new Vector3(0.0, 0.5, 0.0);
                val.y *= state._Scale.y;
                val.Mul(state._Rotation);

                SVO newSVO = new SVO(new Vector3(state._Position.x + val.x, state._Position.y + val.y, state._Position.z + val.z),
                    state._Scale,
                    state._Rotation,
                    state._DistanceFunction,
                    state._DistanceMinimum,
                    state._DistanceScale,
                    state._DistanceOffset,
                    state._StepSize,
                    state._Depth);
                newSVO._Material = GenerateMaterial(state);
                newSVO.CreateElement(state._Preview, state._Parent);
            }
        }
Пример #4
0
        private void SetValue3arg(string target, Vector3 arg, bool overrideState)
        {
            string varname = target;
            int dotindex = target.IndexOf('.');
            if (dotindex >= 0)
            {
                // target is a vector
                varname = target.Substring(0, dotindex);
                string selector = target.Substring(dotindex + 1);
            }

            if (varname.Equals("pos", StringComparison.Ordinal))
            {
                if (overrideState)
                {
                    _Position = arg;
                }
                else
                {
                    Vector3 newval = arg;
                    Vector3 vec = new Vector3();
                    vec.x = newval.x - _Position.x;
                    vec.y = newval.y - _Position.y;
                    vec.z = newval.z - _Position.z;
                    vec.x = vec.x * _Scale.x;
                    vec.y = vec.y * _Scale.y;
                    vec.z = vec.z * _Scale.z;
                    vec.Mul(_Rotation);
                    _Position.x += vec.x;
                    _Position.y += vec.y;
                    _Position.z += vec.z;
                }
            }

            if (varname.Equals("scale", StringComparison.Ordinal))
            {
                _Scale.x = arg.x;
                _Scale.y = arg.y;
                _Scale.z = arg.z;
            }

            if (varname.Equals("diff", StringComparison.Ordinal))
            {
                _Diff._Red = arg.x;
                _Diff._Green = arg.y;
                _Diff._Blue = arg.z;
            }

            if (varname.Equals("refl", StringComparison.Ordinal))
            {
                _Refl._Red = arg.x;
                _Refl._Green = arg.y;
                _Refl._Blue = arg.z;
            }

            if (varname.Equals("emi", StringComparison.Ordinal))
            {
                _Emi._Red = arg.x;
                _Emi._Green = arg.y;
                _Emi._Blue = arg.z;
            }

            if (varname.Equals("spec", StringComparison.Ordinal))
            {
                _Spec._Red = arg.x;
                _Spec._Green = arg.y;
                _Spec._Blue = arg.z;
            }
            if (varname.Equals("abs", StringComparison.Ordinal))
            {
                _Abs._Red = arg.x;
                _Abs._Green = arg.y;
                _Abs._Blue = arg.z;
            }
            if (varname.Equals("v0", StringComparison.Ordinal))
            {
                _v0.x = arg.x;
                _v0.y = arg.y;
                _v0.z = arg.z;
            }
            if (varname.Equals("v1", StringComparison.Ordinal))
            {
                _v1.x = arg.x;
                _v1.y = arg.y;
                _v1.z = arg.z;
            }
            if (varname.Equals("v2", StringComparison.Ordinal))
            {
                _v2.x = arg.x;
                _v2.y = arg.y;
                _v2.z = arg.z;
            }
            if (varname.Equals("v3", StringComparison.Ordinal))
            {
                _v3.x = arg.x;
                _v3.y = arg.y;
                _v3.z = arg.z;
            }
            if (varname.Equals("distanceoffset", StringComparison.Ordinal))
            {
                _DistanceOffset.x = arg.x;
                _DistanceOffset.y = arg.y;
                _DistanceOffset.z = arg.z;
            }
            if (varname.Equals("distanceextents", StringComparison.Ordinal))
            {
                _DistanceExtents.x = arg.x;
                _DistanceExtents.y = arg.y;
                _DistanceExtents.z = arg.z;
            }
            if (IsVectorVariable(varname))
            {
                SetVectorValue(varname, arg);
            }
        }
Пример #5
0
        public override void Execute(ref WooState state)
        {
            if (state._Objects > 0)
            {
                state._Objects--;
                Vector3 val = new Vector3(0.0, 0.5, 0.0);
                val.y *= state._Scale.y;
                val.Mul(state._Rotation);

                Fractal newFractal = new Fractal(new Vector3(state._Position.x + val.x, state._Position.y + val.y, state._Position.z + val.z),
                    state._Scale * 0.5,
                    state._Rotation,
                    state._DistanceMinimum,
                    state._DistanceScale,
                    state._DistanceOffset,
                    state._DistanceIterations,
                    state._DistanceExtents,
                    state._StepSize,
                    state._FractalIterations,
                    state._FractalIterationCount,
                    state._ColourIterationCount,
                    state._DEMode);
                newFractal._Material = GenerateMaterial(state);
                newFractal.CreateElement(state._Preview, state._Parent);
            }
        }