Example #1
0
        private void PaintColorPicker_Click(object sender, EventArgs e)
        {
            ColorChooser2 frm = new ColorChooser2();
            int           r   = (int)(renderWindow1.CurrentBrushColor.Red * 255);
            int           g   = (int)(renderWindow1.CurrentBrushColor.Green * 255);
            int           b   = (int)(renderWindow1.CurrentBrushColor.Blue * 255);
            int           a   = (int)(renderWindow1.CurrentBrushColor.Alpha * 255);

            frm.Color = System.Drawing.Color.FromArgb(a, r, g, b);
            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                renderWindow1.CurrentBrushColor = new Color4(new Vector4((float)frm.Color.R / 255, (float)frm.Color.G / 255, (float)frm.Color.B / 255, 1));
                PaintColorPicker.BackColor      = frm.Color;
            }
            frm.Dispose();
        }
Example #2
0
        private void pickWaterDepthColor_Click(object sender, EventArgs e)
        {
            ColorChooser2 frm = new ColorChooser2();
            int           r   = (int)(renderWindow1.Terrain.info.waterColor.X * 255);
            int           g   = (int)(renderWindow1.Terrain.info.waterColor.Y * 255);
            int           b   = (int)(renderWindow1.Terrain.info.waterColor.Z * 255);
            int           a   = (int)(renderWindow1.Terrain.info.waterColor.W * 255);

            frm.Color = System.Drawing.Color.FromArgb(a, r, g, b);
            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                renderWindow1.Terrain.info.waterColor = new Vector4((float)frm.Color.R / 255, (float)frm.Color.G / 255, (float)frm.Color.B / 255, mapFile.Water_Density);
                mapFile.Water_Color = renderWindow1.Terrain.info.waterColor.ToXYZ();
                renderWindow1.TerrainWater.BuildMesh();
                renderWindow1.TerrainWater.Initialize();
                renderWindow1.Terrain.GenerateCB();
            }
            frm.Dispose();
        }
Example #3
0
        private void ambientColorPicker_Click(object sender, EventArgs e)
        {
            if (renderWindow1.loading)
            {
                return;
            }

            ColorChooser2 frm = new ColorChooser2();
            int           r   = (int)(GlobalConstantVars.AmbientColor.X * 255);
            int           g   = (int)(GlobalConstantVars.AmbientColor.Y * 255);
            int           b   = (int)(GlobalConstantVars.AmbientColor.Z * 255);

            frm.Color = System.Drawing.Color.FromArgb(1, r, g, b);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                GlobalConstantVars.AmbientColor = new Vector4((float)frm.Color.R / 255, (float)frm.Color.G / 255, (float)frm.Color.B / 255, mapFile.Ambient);
                mapFile.Ambient_Color           = GlobalConstantVars.AmbientColor.ToXYZ();
            }
            frm.Dispose();
        }