當前位置: 首頁>>代碼示例>>C#>>正文


C# Color.ToVector3方法代碼示例

本文整理匯總了C#中System.Color.ToVector3方法的典型用法代碼示例。如果您正苦於以下問題:C# Color.ToVector3方法的具體用法?C# Color.ToVector3怎麽用?C# Color.ToVector3使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Color的用法示例。


在下文中一共展示了Color.ToVector3方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawCube

        private static void DrawCube(StructureData str, float size, KeyValuePair<Vector3I, Element> c, ref Color color, string text)
        {
            var local = Matrix.CreateScale(size * 1.02f) * Matrix.CreateTranslation(c.Key * size + new Vector3(0, -c.Value.CurrentOffset / 20.0f, 0));
            Matrix box = local * str.m_grid.WorldMatrix;
            //ten = c.Value.DistanceToStatic.ToString();

            MyRenderProxy.DebugDrawOBB(box, color.ToVector3(), 0.5f, true, true);
            MyRenderProxy.DebugDrawText3D(box.Translation, text, c.Value.Cubes.Count > 1 ? Color.Black : Color.White, 0.5f, false, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
        }
開發者ID:ChristianHeinz71,項目名稱:SpaceEngineers,代碼行數:9,代碼來源:MyOndraDebugIntegrity.cs

示例2: DebugDraw

 internal override void DebugDraw(ref Vector3D worldTranslation, Color color)
 {
     var translation = MatrixD.CreateTranslation(worldTranslation + m_translation);
     var primary = (m_primaryRadius + m_secondaryRadius) * 2;
     var secondary = m_secondaryRadius * 2;
     var scale = MatrixD.CreateScale(primary, secondary, primary);
     MatrixD rotation;
     MatrixD.CreateFromQuaternion(ref m_invRotation, out rotation);
     MatrixD.Transpose(ref rotation, out rotation); // inverse
     var mat = scale * rotation * translation;
     VRageRender.MyRenderProxy.DebugDrawCylinder(mat, color.ToVector3(), 0.5f, true, false);
 }
開發者ID:leandro1129,項目名稱:SpaceEngineers,代碼行數:12,代碼來源:MyCsgShapeTorus.cs

示例3: DebugDraw

 internal override void DebugDraw(ref Vector3D worldTranslation, Color color)
 {
     VRageRender.MyRenderProxy.DebugDrawSphere(worldTranslation + m_translation, m_radius, color.ToVector3(), alpha: 0.5f, depthRead: true, smooth: false);
 }
開發者ID:leandro1129,項目名稱:SpaceEngineers,代碼行數:4,代碼來源:MyCsgSimpleSphere.cs

示例4: DrawCube

        private void DrawCube(float size, Vector3I pos, ref Color color, string text)
        {
            var local = Matrix.CreateScale(size * 1.02f) * Matrix.CreateTranslation(pos * size);
            Matrix box = local * m_grid.WorldMatrix;

            MyRenderProxy.DebugDrawOBB(box, color.ToVector3(), 0.5f, true, true);

            if (DrawText && text != null && text != "0.00" && (Vector3D.Distance(box.Translation, Sandbox.Game.World.MySector.MainCamera.Position) < 30)) 
                 MyRenderProxy.DebugDrawText3D(box.Translation, text, Color.White, 0.5f, false, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
        }
開發者ID:fluxit,項目名稱:SpaceEngineers,代碼行數:10,代碼來源:MyOndraSimulator3.cs

示例5: DebugDraw

        internal override void DebugDraw(ref Vector3D worldTranslation, Color color)
        {
            VRageRender.MyRenderProxy.DebugDrawSphere(worldTranslation + m_translation, m_shapeAttributes.Diameter, color.ToVector3(), alpha: 0.5f, depthRead: true, smooth: false);
            foreach (var noiseSector in m_cachedNoise)
            {

            }
        }
開發者ID:avivbeeri,項目名稱:SpaceEngineers,代碼行數:8,代碼來源:MyCsgShapePlanet.cs

示例6: SetAllColors

 public void SetAllColors(Color newColor)
 {
     m_light.Color = newColor.ToVector4();
     m_light.ReflectorColor = newColor.ToVector4();
     m_light.SpecularColor = newColor.ToVector3();
 }
開發者ID:Bunni,項目名稱:Miner-Wars-2081,代碼行數:6,代碼來源:MyPrefabLight.cs

示例7: OnMyShadowCheckEnable

        /*
        public void OnMyShadowCheckEnable(MyGuiControlCheckbox sender)
        {
            foreach (MyPrefabLight prefabLight in m_prefabLights)
            {
                MyLight myLight = prefabLight.GetLight();

                if (sender == m_spotLightShadowCheckbox)
                {
                    myLight.ShadowsEnabled = sender.Checked;
                }

                prefabLight.OnWorldPositionChanged(this);
                prefabLight.UpdateEffect();
            }
            OnComponentChange(null);
        }
        */
        void OnComponentChange(MyGuiControlSlider sender)
        {
            foreach (MyPrefabLight prefabLight in m_prefabLights)
            {
                MyLight light = prefabLight.GetLight();
                Color tmpColor = new Color();
                tmpColor.R = (byte)m_pointNormalLightColorSlider[0].GetValue();
                tmpColor.G = (byte)m_pointNormalLightColorSlider[1].GetValue();
                tmpColor.B = (byte)m_pointNormalLightColorSlider[2].GetValue();
                light.Color = tmpColor.ToVector4();

                tmpColor.R = (byte)m_specularLightColorSlider[0].GetValue();
                tmpColor.G = (byte)m_specularLightColorSlider[1].GetValue();
                tmpColor.B = (byte)m_specularLightColorSlider[2].GetValue();
                light.SpecularColor = tmpColor.ToVector3();
                light.Falloff = m_pointFallOffSlider.GetValue(); // allowed values 0.1f-5.0f
                light.Range = m_pointRangeSlider.GetValue(); // allowed values 0.0f-MyLightsConstants.MAX_POINTLIGHT_RADIUS
                light.Intensity = prefabLight.m_IntensityMax = m_pointIntensitySlider.GetValue(); // allowed values 0.0f-10.0f
                light.PointLightOffset = m_pointOffsetSlider.GetValue();

                tmpColor.R = (byte)m_spotNormalLightColorSlider[0].GetValue();
                tmpColor.G = (byte)m_spotNormalLightColorSlider[1].GetValue();
                tmpColor.B = (byte)m_spotNormalLightColorSlider[2].GetValue();
                light.ReflectorColor = tmpColor.ToVector4();

                light.ReflectorFalloff = m_spotFallOffSlider.GetValue(); // allowed values 0.1f-5.0f
                light.ReflectorRange = m_spotRangeSlider.GetValue(); // allowed values 0.0f-MyLightsConstants.MAX_SPOTLIGHT_RANGE
                light.ReflectorIntensity = prefabLight.ReflectorIntensityMax = m_spotIntensitySlider.GetValue(); // allowed values 0.0f-10.0f

                light.ReflectorConeDegrees = m_spotAngleSlider.GetValue(); // allowed values 0.0f-MyLightsConstants.MAX_SPOTLIGHT_ANGLE
                light.ShadowDistance = m_spotLightShadowDistance.GetValue();
                prefabLight.FlashOffset = m_flashOffsetSlider.GetValue();
            }
        }
開發者ID:Bunni,項目名稱:Miner-Wars-2081,代碼行數:52,代碼來源:MyGuiControlEditLights.cs


注:本文中的System.Color.ToVector3方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。