OK, how do I change the color of one of these things? First you need to understand how color is made/used in VRML. We use a Red Green Blue color range, with one value representing each color. Each value can vary form zero to one. So Red would look like this 1 0 0, Green would look like 0 1 0, and Blue would look like 0 0 1.

Simple enough you say? OK, 0 0 0 must be Black, and 1 1 1 must be White, therefore 0.5 0.5 0.5 is medium gray, and 0.8 0.8 0.8 would be light gray. That must mean that you can mix different colors by using different percentages of each color, like 0.2 0.6 0.8 or 0.9 0.2 0.2.

You may want to stay with the basic colors for now. When you want to get fancy, I recommend Bob Crispen's ColorPicker program, it looks like the standard windows color selection palette, but it puts the results into your computer's cut & paste buffer. So you select a color (it puts it in the buffer, then you go to the text editor and hit paste ( <ctrl>v ) to fill in the numbers for the color you just created. Let's see an example.

#VRML V2.0 utf8
Transform {
    translation 0 0 0
    children
    [
Shape {
    appearance Appearance {
        material Material { diffuseColor 0 0 1 }
                    }
    geometry Sphere { radius 0.5 }
                }    
        ]
}

OK, that is a little more complicated, but perhaps you can see that we are making a shape, which has an appearance, and that appearance is a material which is the color Blue. That material is applied to the geometry which follows it and therefore the Sphere is blue. On your own try changing the color to green or red, can you make a guess at brown or purple?

Color can (and does) get fancier in vrml, there are several more parameters that you can toy with when mixing up your own. I will not go into detail, but I will provide you with this food for thought. You can alter the material node shown above with additional tags as shown below.

material Material { diffuseColor 0.2 1.0 0.2
                              emissiveColor 0 1 0
                              specularColor 0 0 .2
                              ambientIntensity 0.6    
                              shininess 0.5
                              transparency 0 
                            }

Now, you may not be satisfied with a solid colored ball or cube, that is perfectly understandable, so let's put a picture or a texture on the Sphere.

#VRML V2.0 utf8
Transform {
children [
Shape {
    appearance Appearance {
    texture ImageTexture { url "newfacet.gif"          
                                            "http://philliphansel.org/newfacet.gif"}
### insert your picture or texture in the above URL ###
        }
            geometry Sphere { radius 1.0 }
        }
    ]
}

It is the same as above, except instead of a material, we are using a texture node and an ImageTexture. That ImageTexture happens to be my smiling face, you can use your own face, or any other image (gif or jpg) that you might find on the web. You may notice that there are two paths to the image texture, a relative path (looks in same folder for the file), and an absolute path (looks on my web site for the file). If the first one is not found, it looks for the second one.

Sorry you need a VRML plugin for your browser.

As you see, this makes a simple but effective avatar that you could use at Cybertown. It is small and fast, but extremely personal.

OK, one more small thing. Perhaps you don't have a cool picture of yourself, but you do have a favorite expression that you want to share with everyone. You could do it this way...

#VRML V2.0 utf8
Transform {
children [
    Text {    string     [ "Hello World!" ]    }
    ]
}

  Sorry, you need a VRML plugin to see this.