当前位置: 首页>>代码示例>>C#>>正文


C# Vector3.Mul方法代码示例

本文整理汇总了C#中System.Vector3.Mul方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Mul方法的具体用法?C# Vector3.Mul怎么用?C# Vector3.Mul使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Vector3的用法示例。


在下文中一共展示了Vector3.Mul方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        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);
            }
        }
开发者ID:dom767,项目名称:woofractal,代码行数:14,代码来源:CylinderRule.cs

示例2: Execute

        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);
            }
        }
开发者ID:dom767,项目名称:woofractal,代码行数:17,代码来源:SphereLightRule.cs

示例3: Execute

        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);
            }
        }
开发者ID:dom767,项目名称:woofractal,代码行数:22,代码来源:SVORule.cs

示例4: SetValue3arg

        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))
            {
//.........这里部分代码省略.........
开发者ID:dom767,项目名称:woofractal,代码行数:101,代码来源:WooState.cs

示例5: Execute

        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);
            }
        }
开发者ID:dom767,项目名称:woofractal,代码行数:26,代码来源:FractalRule.cs


注:本文中的System.Vector3.Mul方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。