|
|
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 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. material Material { diffuseColor
0.2 1.0 0.2 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 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. 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 |
|