3-D Visualization Previous page   Next Page

Truecolor Surfaces

Computer systems with 24-bit displays are capable of displaying over 16 million (224) colors, as opposed to the 256 colors available on 8-bit displays. You can take advantage of this capability by defining color data directly as RGB values and eliminating the step of mapping numerical values to locations in a colormap.

Specify truecolor using an m-by-n-by-3 array, where the size of Z is m-by-n.

For example, the statements

create a plot of the peaks matrix with random coloring.

You can set surface properties as with indexed color.

Rendering Methods for Truecolor

MATLAB always uses either OpenGL or the Z-buffer rendering method when displaying truecolor. If the figure RendererMode property is set to auto, MATLAB automatically switches the value of the Renderer property to zbuffer whenever you specify truecolor data.

If you explicitly set Renderer to painters (this sets RendererMode to manual) and attempt to define an image, patch, or surface object using truecolor, MATLAB returns a warning and does not render the object.

See the image, patch, and surface functions for information on defining truecolor for these objects.


Previous page  Altering Colormaps Texture Mapping Next page

© 1994-2005 The MathWorks, Inc.