Esempio n. 1
0
 public void SetAmbientLight(Altaxo.Drawing.AxoColor colorBelow, Altaxo.Drawing.AxoColor colorAbove, double lightAmplitude, VectorD3D directionBelowToAbove)
 {
     directionBelowToAbove = directionBelowToAbove.Normalized;
     HemisphericLightBelowToAboveVector.Set(new Vector3((float)directionBelowToAbove.X, (float)directionBelowToAbove.Y, (float)directionBelowToAbove.Z));
     HemisphericLightColorBelow.Set(ToVector3(colorBelow, lightAmplitude));
     HemisphericLightColorAbove.Set(ToVector3(colorAbove, lightAmplitude));
 }
Esempio n. 2
0
            public void SetCapsuleLight(int idx, Altaxo.Drawing.AxoColor color, double colorAmplitude, PointD3D position, double range, VectorD3D capsuleDirection, double capsuleLength)
            {
                if (range <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(range));
                }

                SetSingleLight(idx, color, colorAmplitude, position, capsuleDirection, 1 / range, capsuleLength, 0, 1);
            }
Esempio n. 3
0
            public void SetSpotLight(int idx, Altaxo.Drawing.AxoColor color, double colorAmplitude, PointD3D position, VectorD3D directionToLight, double range, double cosOuterCone, double cosInnerConeRcp)
            {
                if (range <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(range));
                }

                SetSingleLight(idx, color, colorAmplitude, position, directionToLight, 1 / range, 0, cosOuterCone, cosInnerConeRcp);
            }
Esempio n. 4
0
            public void SetPointLight(int idx, Altaxo.Drawing.AxoColor color, double colorAmplitude, PointD3D position, double range)
            {
                if (range <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(range));
                }

                SetSingleLight(idx, color, colorAmplitude, position, new VectorD3D(1, 0, 0), 1 / range, 0, -1, 1E18);
            }
Esempio n. 5
0
 public static System.Windows.Media.Color ToWpf(this Altaxo.Drawing.AxoColor c)
 {
     if (c.IsFromArgb)
     {
         return(Color.FromArgb(c.A, c.R, c.G, c.B));
     }
     else
     {
         return(Color.FromScRgb(c.ScA, c.ScR, c.ScG, c.ScB));
     }
 }
Esempio n. 6
0
            private void SetSingleLight(int idx, Altaxo.Drawing.AxoColor color, double colorAmplitude, PointD3D position, VectorD3D direction, double lightRangeRcp, double capsuleLength, double spotCosOuterCone, double spotCosInnerConeRcp)
            {
                var sl = new SingleLight()
                {
                    Color               = ToVector3(color, colorAmplitude),
                    Position            = ToVector3(position),
                    Direction           = ToVector3(direction),
                    LightRangeRcp       = (float)lightRangeRcp,
                    CapsuleLength       = (float)capsuleLength,
                    SpotCosOuterCone    = (float)spotCosOuterCone,
                    SpotCosInnerConeRcp = (float)spotCosInnerConeRcp
                };

                _singleLights[idx] = sl;
            }
Esempio n. 7
0
 public void SetSceneBackColor(Altaxo.Drawing.AxoColor sceneBackColor)
 {
     _scene.SetSceneBackColor(sceneBackColor);
 }
Esempio n. 8
0
 public void SetDirectionalLight(int idx, Altaxo.Drawing.AxoColor color, double colorAmplitude, VectorD3D directionToLight)
 {
     directionToLight = directionToLight.Normalized;
     SetSingleLight(idx, color, colorAmplitude, (PointD3D)(directionToLight * 1E7), directionToLight, 0, 0, 0, 1);
 }
Esempio n. 9
0
 public static System.Drawing.Color ToGdi(this Altaxo.Drawing.AxoColor c)
 {
     return(System.Drawing.Color.FromArgb(c.A, c.R, c.G, c.B));
 }