home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09962.iso / vrml / glview.zip / imageTest.wrl < prev    next >
Text File  |  1996-06-28  |  2KB  |  71 lines

  1. #VRML V1.0 ascii
  2.  
  3. # image put into background (could be done also with Layer)
  4. DEF BackgroundImage Info { string  "sun256.bmp" }
  5.  
  6. DEF Title Info { string "GLView test for images and Layer with transparent images"}
  7. DEF Viewer Info { string "examine" }
  8. ShapeHints { vertexOrdering COUNTERCLOCKWISE    shapeType SOLID }
  9.  
  10.  
  11.  
  12.  
  13. Separator {
  14.  
  15.  
  16. # image inserted into world
  17. Separator {
  18.     Translation { translation 3 2 0 }
  19.     # alphas bad for these test images !
  20.     DEF mandrill Image { filename "mandrill.bmp"  alphaColor 1 0 0  alpha 0.0 }
  21. }
  22.  
  23. Separator {
  24.     Translation { translation -6 2 0 }
  25.     USE mandrill 
  26. }
  27.  
  28. WWWInline { 
  29.     bboxCenter 0.001015 0.389670 -2.308155 
  30.     bboxSize 8.334290 11.237420 11.451929
  31.     name "ronny.3dv" }
  32. }
  33.  
  34.  
  35. # overlayed images with transparency  (if alphaColor is good)
  36. Layer {
  37.      depthWrite FALSE
  38.      depthFunc ALWAYS
  39.      lighted FALSE
  40.      ##blend TRUE 
  41.      alphaFunc GREATER
  42.      alphaRef 0.0   # alpha comparaison value 
  43.                 Material {
  44.                     ambientColor    0.00714286 0.00169011 0
  45.                     diffuseColor    0.514286 0.4743647 0.2
  46.                     specularColor   0.760204 0.582954 0.2
  47.                     emissiveColor   0 0 0
  48.                     shininess   0.0408163
  49.                     transparency    0.8 # if used with geometry and blend, make geometry transparent
  50.                 }
  51.  
  52.      Translation { translation -1 -1 0 }
  53.      ScaledImage {
  54.                 scale TO_WINDOW   scaleFactor 0.25 0.25
  55. ##              scale BY_FACTOR    scaleFactor 0.7 0.5
  56.                 srcImage DEF i Image { 
  57.                         filename "ronny.bmp"  alphaColor 0 0 0  alpha 0.0
  58.                  }
  59.      }   
  60.      Translation { translation 1.5 0 0 }
  61.      ScaledImage {
  62.                 scale TO_WINDOW   scaleFactor -0.25 0.25
  63.                 srcImage USE i
  64.      }   
  65.  
  66. }
  67.  
  68.  
  69.  
  70.  
  71.