Open topic with navigation
<texture>.setImageData
Set the raw pixel data of the image
<texture>.setImageData( |
|
data |
size |
format = viz.TEX_RGB |
face = viz.POSITIVE_X |
) |
|
data
String or buffer object containing raw pixel data.
size
A list specifying the dimensions of the texture.
viz.TEX_1D only requires a single dimension, [width].
viz.TEX_2D, viz.TEX_RECT, and viz.TEX_CUBE require 2 dimensions, [width,height].
viz.TEX_3D requires 3 dimensions, [width,height,depth].
format = viz.TEX_RGB
Texture format. Can be one of the following:
viz.TEX_RGB
viz.TEX_RGBA
viz.TEX_BGR
viz.TEX_BGRA
viz.TEX_RGB_16
viz.TEX_RGBA_16
viz.TEX_RGB_32
viz.TEX_RGBA_32
viz.TEX_LUMINANCE
viz.TEX_ALPHA
viz.TEX_LUMINANCE_ALPHA
face = viz.POSITIVE_X
This is an optional argument used only with Cube Mapped textures.
With Cube Mapped textures it specifies which face of the cube to apply the image to. This can be one of the following values:
viz.POSITIVE_X
viz.NEGATIVE_X
viz.POSITIVE_Y
viz.NEGATIVE_Y
viz.POSITIVE_Z
viz.NEGATIVE_Z
Remarks
This command will modify the existing texture to contain the new image data. This will affect the appearance of all nodes that the texture was previously applied to.
Return Value
True/False
See also