




![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Mapping Images

Mapping images is a fairly simple process that you can have some fun with. You can map an image onto any object, although there may be times when you might have to experiment to get the results you want, depending on what it is you are trying to do.
Looking at the script, you will notice that the line "diffuseColor 0.0 0.0 0.0" has been replaced with "texture ImageTexture { url "image.gif" }. We are telling the computer that we want to use the texture node and to apply a certain image. The image does not have to be a gif file, it can be jpg or bmp. The complete image will be mapped onto each side of the box, and then stretched, or compressed to fit.
#VRML V2.0 utf8
Shape {
appearance Appearance {
material Material { }
texture ImageTexture {
url "image.gif"
}
}
geometry Box {
size 3.0 3.0 3.0
}
}