Post

PixelTexture

PixelTexture

Overview

PixelTexture creates a 2D-image texture map using a numeric array of pixel values. Texture maps have a 2D coordinate system (s, t) horizontal and vertical, with (s, t) texture-coordinate values in range [0.0, 1.0] for opposite corners of the image.

The PixelTexture node belongs to the Texturing component and requires at least level 1, its default container field is texture. It is available since VRML 2.0 and from X3D version 3.0 or higher.

Hierarchy

1
2
3
4
5
6
+ X3DNode
  + X3DAppearanceChildNode
    + X3DTextureNode
      + X3DSingleTextureNode
        + X3DTexture2DNode
          + PixelTexture

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFString [in, out] description “”

Author-provided prose that describes intended purpose of the url asset.

Hint

  • Many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for “ quotation-mark character).

SFImage [in, out] image 0 0 0

Defines image: width, height, number_of_components per each pixel value, and list of pixel_values. Note that width and height are pixel count, and allowed values for RGBA number_of_components in each pixel value are 1 (intensity), 2 (intensity alpha), 3 (red green blue), 4 (red green blue alpha-opacity).

Hints

  • It is easier to understand hexadecimal values for each pixel, but integer values are also allowed.
  • The array of pixel values has length = (width*height).
  • The full list of integers in this field has length = (width*height + 3).

Warning

  • The order of initial values in PixelTexture and PixelTexture3D image arrays are different. Example: intensity [1 2 1 0xFF 0x00] Example: intensity-alpha [2 2 1 0 255 255 0] Example: red-green-blue [2 4 3 0xFF0000 0xFF00 0 0 0 0 0xFFFFFF 0xFFFF00] Example: red-green-blue-alpha [2 2 4 0xFFFFFFAA 0xFFFF00AA 0x11111111AA 0x787800AA]

SFBool [ ] repeatS TRUE

Whether to repeat texture along S axis horizontally from left to right.

SFBool [ ] repeatT TRUE

Whether to repeat texture along T axis vertically from top to bottom.

SFNode [ ] textureProperties NULL [TextureProperties]

Single contained TextureProperties node that can specify additional visual attributes applied to corresponding texture images.

Advice

Hints

Warnings

Example

See Also

This post is licensed under CC BY 4.0 by the author.