Exemplo n.º 1
0
        public DirectionalLight(float H, float S, float V, Vector3 lightDirection, string name)
        {
            // calculate light color
            difHue        = H;
            difSaturation = S;
            difIntensity  = V;
            ColorTools.HSV2RGB(difHue, difSaturation, difIntensity, out difR, out difG, out difB);

            direction = lightDirection;

            this.id = name;
        }
Exemplo n.º 2
0
        private static Vector3 CreateFogColorFromFogSet(ParamFile lightSet, int i)
        {
            float hue = (float)RenderTools.GetValueFromParamFile(lightSet, 2, 1 + i, 0);
            float saturation = (float)RenderTools.GetValueFromParamFile(lightSet, 2, 1 + i, 1);
            float value = (float)RenderTools.GetValueFromParamFile(lightSet, 2, 1 + i, 2);
            float fogR = 0.0f, fogB = 0.0f, fogG = 0.0f;

            ColorTools.HSV2RGB(hue, saturation, value, out fogR, out fogG, out fogB);
            Vector3 color = new Vector3(fogR, fogG, fogB);

            return(color);
        }
Exemplo n.º 3
0
        public HemisphereFresnel(float groundH, float groundS, float groundV, float skyH, float skyS, float skyV,
                                 float skyAngle, float groundAngle, string name)
        {
            this.groundHue        = groundH;
            this.groundSaturation = groundS;
            this.groundIntensity  = groundV;
            this.skyHue           = skyH;
            this.skySaturation    = skyS;
            this.skyIntensity     = skyV;
            ColorTools.HSV2RGB(skyHue, skySaturation, skyIntensity, out skyR, out skyG, out skyB);

            this.skyAngle    = skyAngle;
            this.groundAngle = groundAngle;

            this.name = name;
        }
Exemplo n.º 4
0
        public DirectionalLight(float difH, float difS, float difV, float ambH, float ambS, float ambV, float rotX, float rotY, float rotZ, string name)
        {
            // calculate light color
            difHue        = difH;
            difSaturation = difS;
            difIntensity  = difV;
            ambHue        = ambH;
            ambSaturation = ambS;
            ambIntensity  = ambV;
            ColorTools.HSV2RGB(difHue, difSaturation, difIntensity, out difR, out difG, out difB);
            ColorTools.HSV2RGB(ambHue, ambSaturation, ambIntensity, out ambR, out ambG, out ambB);

            // calculate light vector
            this.rotX = rotX;
            this.rotY = rotY;
            this.rotZ = rotZ;
            UpdateDirection(rotX, rotY, rotZ);

            this.id = name;
        }
Exemplo n.º 5
0
        public DirectionalLight(float difH, float difS, float difV, float ambH, float ambS, float ambV, float rotX, float rotY, float rotZ, string name)
        {
            // calculate light color
            difHue        = difH;
            difSaturation = difS;
            difIntensity  = difV;
            ambHue        = ambH;
            ambSaturation = ambS;
            ambIntensity  = ambV;
            ColorTools.HSV2RGB(difHue, difSaturation, difIntensity, out difR, out difG, out difB);
            ColorTools.HSV2RGB(ambHue, ambSaturation, ambIntensity, out ambR, out ambG, out ambB);

            // calculate light vector
            this.rotX = rotX;
            this.rotY = rotY;
            this.rotZ = rotZ;
            Matrix4 lightRotMatrix = Matrix4.CreateFromAxisAngle(Vector3.UnitX, rotX * ((float)Math.PI / 180f))
                                     * Matrix4.CreateFromAxisAngle(Vector3.UnitY, rotY * ((float)Math.PI / 180f))
                                     * Matrix4.CreateFromAxisAngle(Vector3.UnitZ, rotZ * ((float)Math.PI / 180f));

            direction = Vector3.Transform(new Vector3(0f, 0f, 1f), lightRotMatrix).Normalized();

            this.id = name;
        }
Exemplo n.º 6
0
 public void setGroundIntensity(float groundIntensity)
 {
     this.groundIntensity = groundIntensity;
     ColorTools.HSV2RGB(groundHue, groundSaturation, groundIntensity, out groundR, out groundG, out groundB);
 }
Exemplo n.º 7
0
 public void setSkyIntensity(float skyIntensity)
 {
     this.skyIntensity = skyIntensity;
     ColorTools.HSV2RGB(skyHue, skySaturation, skyIntensity, out skyR, out skyG, out skyB);
 }
Exemplo n.º 8
0
 public void setAmbIntensity(float intensity)
 {
     this.ambIntensity = intensity;
     ColorTools.HSV2RGB(ambHue, ambSaturation, ambIntensity, out ambR, out ambG, out ambB);
 }
Exemplo n.º 9
0
 public void setAmbSaturation(float saturation)
 {
     this.ambSaturation = saturation;
     ColorTools.HSV2RGB(ambHue, ambSaturation, ambIntensity, out ambR, out ambG, out ambB);
 }
Exemplo n.º 10
0
 public void setAmbHue(float hue)
 {
     this.ambHue = hue;
     ColorTools.HSV2RGB(ambHue, ambSaturation, ambIntensity, out ambR, out ambG, out ambB);
 }
Exemplo n.º 11
0
 public void setDifIntensity(float intensity)
 {
     this.difIntensity = intensity;
     ColorTools.HSV2RGB(difHue, difSaturation, difIntensity, out difR, out difG, out difB);
 }
Exemplo n.º 12
0
 public void setDifSaturation(float saturation)
 {
     this.difSaturation = saturation;
     ColorTools.HSV2RGB(difHue, saturation, difIntensity, out difR, out difG, out difB);
 }
Exemplo n.º 13
0
 public void setDifHue(float hue)
 {
     this.difHue = hue;
     ColorTools.HSV2RGB(hue, difSaturation, difIntensity, out difR, out difG, out difB);
 }