An AntTweakBar variable which can hold an RGBA color value.
Inheritance: Variable, IValueVariable
Ejemplo n.º 1
0
        public override void BuildUI(Context UIContext)
        {
            var exampleBar = new Bar(form.Context);

            exampleBar.Label     = "BRDF Models";
            exampleBar.Contained = true;

            // here we bind the variables to the renderer variables with their Changed event
            // (their initial value is whatever the renderer currently has set them to)

            var color1Var = new VectorVariable(exampleBar, this.lightDirection.X,
                                               this.lightDirection.Y,
                                               this.lightDirection.Z, "axisx=x axisy=y axisz=-z");

            color1Var.Label = "LightDirection";

            color1Var.Changed += delegate {
                this.lightDirection.X = color1Var.X;
                this.lightDirection.Y = color1Var.Y;
                this.lightDirection.Z = color1Var.Z;
            };

            var roughnessOrenNayar = new FloatVariable(exampleBar, 0.5f, "label='Roughness' min=0.0 max=1.0 step=0.01");

            var DiffuseModels = new AntTweakBar.EnumVariable <Diffuse>(exampleBar, Diffuse.OrenNayar, "label= 'Diffuse'");

            var SpecularModels = new AntTweakBar.EnumVariable <Specular>(exampleBar, Specular.BlinnPhong, "label= 'Specular'");

            var ColorObj = new AntTweakBar.Color4Variable(exampleBar, this.ColorObject.X, this.ColorObject.Y, this.ColorObject.Z, this.ColorObject.W);

            ColorObj.Label = "Color Object";

            ColorObj.Changed += delegate {
                this.ColorObject.X = ColorObj.R;
                this.ColorObject.Y = ColorObj.G;
                this.ColorObject.Z = ColorObj.B;
                this.ColorObject.W = ColorObj.A;
            };

            /*botaoStatua.Changed += delegate
             * {
             *  this.modelMesh = //carrega estatua
             *  this.orenNayarRoughness = //rou
             *
             * }*/

            roughnessOrenNayar.Changed += delegate
            {
                this.orenNayarRoughness = roughnessOrenNayar.Value;
            };

            DiffuseModels.Changed += delegate
            {
                this.myDiffuse = DiffuseModels.Value;
            };

            SpecularModels.Changed += delegate
            {
                this.mySpecular = SpecularModels.Value;
            };
        }