How to use the color.g function in color

To help you get started, we’ve selected a few color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xeolabs / scenejs / examplesold / pages / lights / directionalView.html View on Github external
var Menu = function () {

                    this.message = "Positional light";

                    this["dir.x"] = 5.0;
                    this["dir.y"] = -5.0;
                    this["dir.z"] = -5.0;

                    this["color.r"] = 1.0;
                    this["color.g"] = 1.0;
                    this["color.b"] = 1.0;

                    this.specular = true;
                    this.diffuse = true;

                    var self = this;

                    // This is actually quite inefficient because it continually updates
                    // the scene graph, forcing frames to continually re-render.
                    // Your GPU's not going to like it, but it's just for a quick and dirty demo.
                    var update = function () {

                        myLights.setLights({
                            "0":{
                                dir:{
                                    x:self["dir.x"],
github xeolabs / scenejs / examples / postprocessing_fog.html View on Github external
var Menu = function () {

                    this.start = myFog.getStart();
                    this.end = myFog.getEnd();
                    this.density = myFog.getDensity();
                    this.mode = myFog.getMode();

                    var color = myFog.getColor();

                    this["color.r"] = color.r;
                    this["color.g"] = color.g;
                    this["color.b"] = color.b;

                    var self = this;

                    // This is actually quite inefficient because it continually updates
                    // the scene graph, forcing frames to continually re-render.
                    // Your GPU's not going to like it, but it's just for a quick and dirty demo.
                    var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r:self["color.r"],
                            g:self["color.g"],
github xeolabs / scenejs / examples / lighting_directional_view.html View on Github external
var Menu = function () {

                    this.message = "Directional light";

                    this["dir.x"] = 5.0;
                    this["dir.y"] = -5.0;
                    this["dir.z"] = -5.0;

                    this["color.r"] = 1.0;
                    this["color.g"] = 1.0;
                    this["color.b"] = 1.0;

                    this.specular = true;
                    this.diffuse = true;

                    var self = this;

                    // This is actually quite inefficient because it continually updates
                    // the scene graph, forcing frames to continually re-render.
                    // Your GPU's not going to like it, but it's just for a quick and dirty demo.
                    var update = function () {

                        myLights.setLights({
                            "0":{
                                dir:{
                                    x:self["dir.x"],
github xeolabs / scenejs / examples / shaders_fog.html View on Github external
var Menu = function () {

                    this.start = myFog.getStart();
                    this.end = myFog.getEnd();
                    this.density = myFog.getDensity();
                    this.mode = myFog.getMode();

                    var color = myFog.getColor();

                    this["color.r"] = color.r;
                    this["color.g"] = color.g;
                    this["color.b"] = color.b;

                    var self = this;

                    // This is actually quite inefficient because it continually updates
                    // the scene graph, forcing frames to continually re-render.
                    // Your GPU's not going to like it, but it's just for a quick and dirty demo.
                    var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r: self["color.r"],
                            g: self["color.g"],
github xeolabs / scenejs / api / latest / extras / gui.js View on Github external
var Menu = function () {

            this["dir.x"] = 5.0;
            this["dir.y"] = -5.0;
            this["dir.z"] = -5.0;
            this["color.r"] = 1.0;
            this["color.g"] = 1.0;
            this["color.b"] = 1.0;
            this.specular = true;
            this.diffuse = true;

            var self = this;

            var update = function () {
                lights.setLights({
                    "0":{
                        dir:{
                            x:self["dir.x"],
                            y:self["dir.y"],
                            z:self["dir.z"]
                        },
                        color:{
                            r:self["color.r"],
github xeolabs / scenejs / examples / libs / gui / gui.js View on Github external
var update = function () {
                lights.setLights({
                    "0":{
                        pos:{
                            x:self["pos.x"],
                            y:self["pos.y"],
                            z:self["pos.z"]
                        },
                        color:{
                            r:self["color.r"],
                            g:self["color.g"],
                            b:self["color.b"]
                        },
                        dir:{
                            x:self["dir.x"],
                            y:self["dir.y"],
                            z:self["dir.z"]
                        },
                        innerCone:self.innerCone,
                        outerCone:self.outerCone,
                        constantAttenuation:self.constantAttenuation,
                        linearAttenuation:self.linearAttenuation,
                        quadraticAttenuation:self.quadraticAttenuation,
                        specular:self.specular,
                        diffuse:self.diffuse
                    }
                });
github xeolabs / scenejs / examples / postprocessing_fog.html View on Github external
var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r:self["color.r"],
                            g:self["color.g"],
                            b:self["color.b"]
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / examplesold / pages / plugins / fx / fog.html View on Github external
var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r:self["color.r"],
                            g:self["color.g"],
                            b:self["color.b"]
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / examples / lighting_directional_view.html View on Github external
var update = function () {

                        myLights.setLights({
                            "0":{
                                dir:{
                                    x:self["dir.x"],
                                    y:self["dir.y"],
                                    z:self["dir.z"]
                                },

                                color:{
                                    r:self["color.r"],
                                    g:self["color.g"],
                                    b:self["color.b"]
                                },
                                specular:self.specular,
                                diffuse:self.diffuse
                            }
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / examples / shaders_fog.html View on Github external
var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r: self["color.r"],
                            g: self["color.g"],
                            b: self["color.b"]
                        });

                        requestAnimationFrame(update);
                    };