Vizard 8 » Tutorials & Examples » Appearance & texturing » Multitexturing » Tutorial: Multitexturing
8.0

Tutorial: Multi-texturing

This tutorial will teach you the basics of multi-texturing. Multi-texturing allows you to apply multiple textures to an object. In this example we will apply two textures to an object and let the user control how to blend the two texture using a slider.

Note: this content is discussed in more detail in the reference section.

Loading multiple textures

If you have trouble getting the code in this tutorial to work, you can find the complete example script multiTexture.py in the \tutorials\appearance directory.

 

After creating the empty script add the following initial code to it:

import viz
import vizfx
import vizact

viz.setMultiSample(4)
viz.fov(60)
viz.go()

First we need an object to apply the textures to. The following code adds the vizard logo to the world and places it in front of the user:

logo = viz.addChild('logo.ive')
logo.setPosition([0,1,3])

Next, let's add the two textures that we will apply to the logo:

tex1 = viz.addTexture('gb_noise.jpg')
tex2 = viz.addTexture('brick.jpg')

Loading multiple textures

Blending the textures

Real-time adjustments