Vizard 7 » Reference » Appearance & Texturing » Appearance & Texturing basics
7.6

Appearance and Texture Basics

Vizard uses a variety of OpenGL features along with its own commands to change the visual appearance or rendering of 3D objects.

Color

To change the color appearance of your 3D object, modify it with <node3d>.color, using either three arguments for red, green, and blue (ranged between 0 and 1) or a Vizard flag.

ball = viz.add('white_ball.wrl')
ball.color( viz.PURPLE )

Texturing

A texture is an image that is applied to color the polygons of a 3D object. Vizard reads the following file formats as textures: jpeg, bmp, tif, gif, png, rgb, rgba, tga, dds, pic. Video files can also be used as textures (see Video basics). To add a texture to your script, use <viz>.addTexture and apply the texture objects using <node3d>.texture. Textures can also be applied in layers (see Multi-texturing for combining images).  

#Add an object.
ball = viz.add( 'white_ball.wrl' )
#Add a texture.
sky = viz.addTexture( 'brick.jpg' )
#Apply the texture to the object.
ball.texture( sky )

Textures can be applied in a variety of ways to models (see Texture wrapping), using various filters, and can be manipulated using a transformation matrix for texture coordinates (see Texture matrix).

Visibility

The visibility of any 3D object or window can be turned on and off with <node3d>.visible.  An object can be rendered semi-transparent by setting its alpha values with <node3d>.alpha. See the section on visibility for more details.

#Add an object.
ball = viz.add( 'white_ball.wrl' )
#Make it disappear with a keystroke.
vizact.onkeydown( ' ', ball.visible, viz.OFF )

Render states

Vizard allows you to enable or disable various features of an object's rendering with <node3d>.enable and <node3d>.disable. Check out these commands in the command index for more details.  

See also

In this section:

Texture wrapping

Multi-texturing

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

Tutorial: Environmental mapping

Tutorial: 360 panoramas

Example scripts:

Projection

Environment mapping

Shadows

Alpha map

Multi texture