Xj3D Cubic Environment Mapping Extension Examples

Simple textured sphere

#X3D V3.0 utf8

PROFILE Interchange
COMPONENT xj3d_EnvironmentTexturing:1

Shape {
  appearance Appearance {
    texture ImageCubeMapTexture {
		front "front.jpg"
		back "back.jpg"
		left "left.jpg"
		right "right.jpg"
		top "top.jpg"
		bottom "bottom.jpg"
    }
  }
  geometry Sphere {}
}
This will not look correct because the sphere does not have automatic texture coordinate generation being used, nor is it possible to specify it. To look correct, one of the explicit polygonal nodes should be used, along with an instance of TextureCoordinateGenerator.

Using different texture types

#X3D V3.0 utf8

PROFILE Interchange
COMPONENT xj3d_EnvironmentTexturing:1

Shape {
  appearance Appearance {
    texture ComposedCubeMapTexture {
      front ImageTexture { url "front_chrome.jpg" }
      back  PixelTexture { image [ 2 2 1  0x0 0xFF 0xFF 0x00 ] }
    }
  }
  geometry Sphere {}
}
Note that the Image texture is thus required to be a 2x2 pixel texture.


[ Xj3D Homepage | Xj3D @ Web3d | Screenshots | Dev docs | Dev Releases | Contributors | Getting Started ]
Last updated: $Date: 2004-09-13 06:15:40 $