3-D Visualization | ![]() ![]() |
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.
create a plot of the peaks
matrix with random coloring.
You can set surface properties as with indexed color.
Rendering Method for Truecolor
MATLAB always uses either OpenGL or the zbuffer render 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.
Simulating Truecolor - Dithering
You can use truecolor on computers that do not have 24-bit displays. In this case, MATLAB uses a special colormap designed to produce results that are as close as possible, given the limited number of colors available. See Dithering Truecolor on Indexed Color Systems in the "Figure Properties" chapter for more information on the use of a dithermap.
![]() | Altering Colormaps | Texture Mapping | ![]() |