Transparency

Example from: The Annotated VRML 2.0 Reference Manual


Group { children [
  Transform {
    translation -3 2.5 0
    children Shape { geometry DEF S Sphere {}
      appearance Appearance {
        material Material { diffuseColor 0.2 0.2 0.2 }
      }
    }
  }
  Transform {
    translation 0 2.5 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material { diffuseColor .5 .5 .5 }
      }
    }
  }
  Transform {
    translation 3 2.5 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material { diffuseColor 1 1 1 }
      }
    }
  }
  Transform {
    translation 6 2.5 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material { diffuseColor 1 1 1 emissiveColor 0.5 0.5 0.5 }
      }
    }
  }
  Transform {
    translation -3 0 0
    children Shape { geometry DEF S Sphere {}
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.01
        }
      }
    }
  }
  Transform {
    translation 0 0 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.5
	}
      }
    }
  }
  Transform {
    translation 3 0 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.98
	}
      }
    }
  }
  Transform {
    translation 6 0 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.98
	  emissiveColor 0.5 0.5 0.5
	}
      }
    }
  }
  Transform {
    translation -3 -2.5 0
    children Shape { geometry DEF S Sphere {}
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.5
	  transparency 0.2
        }
      }
    }
  }
  Transform {
    translation 0 -2.5 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.5
	  transparency 0.5
	}
      }
    }
  }
  Transform {
    translation 3 -2.5 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.5
	  transparency 0.8
	}
      }
    }
  }
  Transform {
    translation 6 -2.5 0
    children Shape { geometry USE S
      appearance Appearance {
        material Material {
	  specularColor 1 1 1
	  shininess 0.5
	  transparency 0.8
	  emissiveColor 0.5 0.5 0.5
	}
      }
    }
  }
  Shape {
    geometry IndexedFaceSet {
      coord Coordinate { point [ -4 -4 -2, 7 -4 -2, 7 -3 -2, -4 -3 -2 ] }
      coordIndex [ 0 1 2 3 ]
    }
    appearance Appearance { texture ImageTexture { url "celtic.gif" } }
  }
  Background { skyColor 1 1 1 }
  DirectionalLight { direction -.65 0 -.85 }
  NavigationInfo { type "EXAMINE" headlight FALSE }
]}



mrl