Vizard 7 » Reference » Appearance & Texturing » Multi-texturing
7.6

Multi-texturing

Multitexturing allows you to apply more than one texture at time on a node 3D object. There are several methods to combining textures, and it is best play around with blending yourself to get the desired effect.

 

The following script demonstrates binding multiple textures to a 3D node and using a slider to specify the blend amount:

import viz
viz.go()

import viz
viz.go()

#Load model
logo = viz.add('logo.wrl')
logo.setPosition(0,2,5)

#Load textures
tex1 = viz.add('gb_noise.jpg')
tex2 = viz.add('ball.jpg')

#Apply textures
logo.texture(tex1)
logo.texture(tex2,'',1)

#Blend texture layer 1 with layer 0 by 50%
logo.texblend(0.5,'',1)

#Add the slider and set to 50%
slider = viz.addSlider(pos=[0.5,0.1,0])
slider.set(0.5)

def blendTextures(pos):
    #Blend texture layer 1 with layer 0 by amount specified by slider position
    logo.texblend(pos,'',1)

vizact.onslider(slider, blendTextures)

See also

In this section:

Appearance & texturing basics

Texture wrapping

Environment mapping

Texture appearance and filtering

Texture types

Texture matrix

Visibility

Draw order & Z offsetting

Projecting textures

Appearance & texturing command table

Other sections:

Tutorial: Applying Textures

Tutorial: Multi-texturing

Example scripts:

Multi texture