3-D Visualization |
Specifying a Single Transparency Value
Specifying a single transparency value for graphics objects is useful when you want to reveal structure that is obscured with opaque objects. For patches and surfaces, use the FaceAlpha
and EdgeAlpha
properties to specify the transparency of faces and edges. The following example illustrates this.
Example -- Transparent Isosurface
This example uses the flow
function to generate data for the speed profile of a submerged jet within an infinite tank. One way to visualize this data is by creating an isosurface illustrating where the rate of flow is equal to a specified value.
[x y z v] = flow; p = patch(isosurface(x,y,z,v,-3)); isonormals(x,y,z,v,p); set(p,'facecolor','red','edgecolor','none'); daspect([1 1 1]); view(3); axis tight; grid on; camlight; lighting gouraud;
Adding transparency to the isosurface reveals that there is greater complexity in the fluid flow than is visible using the opaque surface. The statement
sets the FaceAlpha
value for the isosurface face to .5.
Setting a Single Transparency Value for Images
sets AlphaData
to .5. When the AlphaDataMapping
property is set to none
(the default), setting AlphaData
on an image causes the entire image to be rendered with the specified alpha value.
Specifying Transparency | Mapping Data to Transparency -- Alpha Data |
© 1994-2005 The MathWorks, Inc.