This page contains VRML 2.0 materials converted from the SGI's Open Inventor material examples.


by David Roussel

Conversion example :

Inventor VRML 2.0

#Inventor V1.0 ascii

#artdeco00.iv

Material 
{
   
ambientColor 
0.0706087 0.0212897 0.0336154
   
diffuseColor 
0.282435 0.0851587 0.134462
   
specularColor 
0.276305 0.11431 0.139857
   
emissiveColor 
0 0 0
   
shininess 
0.127273
   
transparency 
0
}


#VRML V2.0 utf8


PROTO
 Artdeco00 [] {
  
Material
 {
    
ambientIntensity 
0.250000
    
diffuseColor 
0.282435 0.085159 0.134462
    
specularColor 
0.276305 0.114310 0.139857
    
emissiveColor 
0.000000 0.000000 0.000000
    
shininess 
0.127273
    
transparency 
0.000000
  }
}

VRML2.0 "ambientIntensity" is calculated by the mean factor between the Inventor "ambientColor" and "diffuseColor".

How to use these materials :

VRML 2.0 supports Prototypes definitions as well as External Prototypes, the easiest way to use these materials is to gather the materials inside a separate file and declare an EXTERNPROTO in the file you want to use these materials (see example below).

Unfortunately, most of the VRML 2.0 browsers doesn't seem to support external prototypes (especially PC versions), so you might as well cut an paste any material prototype inside the file you want to use it.

External prototype usage :

file : Materials.wrl

#VRML V2.0 utf8


PROTO
 MyMaterial00 [] {
    
Material
 {
        
ambientIntensity 
0.263158
        
diffuseColor 
0.345455 0.163262 0.122622
        
specularColor 
0.212121 0.107475 0.000000
        
emissiveColor 
0.021212 0.010747 0.000000
        
shininess 
0.048649
        
transparency 
0.100000
    }
}

.
.
.


PROTO
 MyMaterial27 [] {
    
Material
 {
        
ambientIntensity 
0.240506
        
diffuseColor 
0.277281 0.104336 0.079900
        
specularColor 
0.305587 0.141916 0.2705727
        
emissiveColor 
0.030559 0.014192 0.0270573
        
shininess 
0.096970
        
transparency 
0.000000
    }
}

Materials prototype definition with PROTO
Note that these PROTO have no field nor events to rule their behaviour as they are only "definitions".
file : Material_example.wrl

#VRML V2.0 utf8


EXTERNPROTO
 MyMaterial07 
[] "http://.../Materials.wrl#MyMaterial07"

EXTERNPROTO
 MyMaterial15 
[] "http://.../Materials.wrl#MyMaterial15"

.
.
.


Group 
{
    
children 
[
       
DEF 
Right_Object 
Transform 
{
           
translation 
2 0 0
           
children 
[
               
Shape 
{
                   
appearance Appearance 
{
                       
material MyMaterial07
 {}
                   }
                   
geometry Sphere 
{}
               }
           ]
       },
       
DEF 
Left_Object 
Transform 
{
           
translation 
-2 0 0
           
children 
[
               
Shape 
{
                   
appearance Appearance 
{
                       
material MyMaterial15
 {}
                   }
                   
geometry Cylinder 
{}
               }
           ]
       }
    ]
}

All the PROTO to be used should be instancied using an EXTERNPROTO statement refering to the Material definition file with an URL field.
 
Test View
Click Here to check your VRML browser for external Prototype capabilities, you should get something like this :
 


Send any comments or suggestions to David Roussel