home *** CD-ROM | disk | FTP | other *** search
/ Late Night VRML 2.0 with Java CD-ROM / code.zip / Ch10 / 5041101.wrl next >
Text File  |  1996-12-17  |  956b  |  47 lines

  1. #VRML V2.0 utf8
  2. #Example 11.1 - Textures with Materials
  3. NavigationInfo {
  4.   type EXAMINE
  5. }
  6. Viewpoint {
  7.   position   0 0 8
  8.   orientation       0 0 1  0
  9.   fieldOfView       0.785398
  10. }
  11. Group {
  12.   children   [
  13.     Transform {
  14.       children Shape {       # Cube with texture but no material
  15.         appearance Appearance {
  16.         texture    ImageTexture {
  17.           url      "wood-1.jpg"
  18.           }
  19.         }
  20.         geometry   Box {
  21.         }
  22.       }
  23.       translation -2 0 0
  24.     }
  25.     Transform {
  26.       children Shape {           # Cube with texture and material
  27.         appearance  Appearance {
  28.           material  Material {
  29.             ambientIntensity    0.2
  30.             diffuseColor  0.8 0.5 0.15
  31.             specularColor 0.3 0.1 0
  32.             shininess     0.8
  33.           }
  34.           texture   ImageTexture {
  35.             url     "wood-1.jpg"
  36.           }
  37.         }
  38.         geometry    Box {
  39.         }
  40.       }
  41.       translation   2 0 0
  42.     }
  43.   ]
  44. }
  45. #EOF
  46.  
  47.