Vizard 7 » Command Index » Vizard objects » node3d » <node3d>.texture
7.6

<node3d>.texture

This action changes the image map of an existing textured object to a new image map

<node3d>.texture(  
texture  
node = ''  
unit = 0  
op = viz.OP_DEFAULT  
)  
texture
Specifies the texture object to apply to the named sub-object. If viz.OFF is specified then the current texture will be removed.
node = ''
Name of sub-node to apply changes to
unit = 0
Specifies the texture unit to apply to (Used for multitexturing)
op = viz.OP_DEFAULT
Can be viz.OP_DEFAULT to use the nodes default op mode or a combination of the following values:

Op modes

viz.OP_TRAVERSE

When performing an operation on a node, traverse the entire subgraph and process all subnodes as well. This is the default value.

viz.OP_OVERRIDE

When applying attributes, have them override attributes of subnodes.

viz.OP_ROOT

When performing an operation on the node, start at the root transform of the node, instead of the model. Processing the root will include all child Vizard nodes.

Remarks

Use this action to change an existing texture on an object to a different texture (this texture must already be loaded by the addTexture command). The changes will be local to the target object and only applied to sub-objects (nodes) with names matching the subObjectName parameter specified. The (u,v) texture coordinates will remain unchanged. This action can be used to swap the textures on a frame-by-frame basis and create texture animation effects.

Return Value

None

Example

screen = viz.add('moviescreen.wrl')
newTex = viz.addTexture('gb_noise.jpg')
screen.texture(newTex, 'mymoviescreen')

See also

<node3d>.appearance
<viz>.addTexture