3-D Visualization - The MathWorks - #39

/ 212


catalogue search
P. 01
P. 02
P. 03
P. 04
P. 05
P. 06
P. 07
P. 08
P. 09
P. 10
P. 11
P. 12
P. 13
P. 14
P. 15
P. 16
P. 17
P. 18
P. 19
P. 20
P. 21
P. 22
P. 23
P. 24
P. 25
P. 26
P. 27
P. 28
P. 29
P. 30
P. 31
P. 32
P. 33
P. 34
P. 35
P. 36
P. 37
P. 38
P. 39
P. 40
P. 41
P. 42
P. 43
P. 44
P. 45
P. 46
P. 47
P. 48
P. 49
P. 50


See other catalogues for The MathWorks

Text version of the page
Coloring Mesh and Surface Plots
size to any surface. MATLAB interpolates texture color data so that it is mapped to the entire surface.
Example — Texture Mapping a Surface
This example creates a spherical surface using the sphere function and texture maps it with an image of the earth taken from space. Because the earth image is a view of earth from one side, this example maps the image to only one side of the sphere, padding the image data with 1s In this case, the image data is a 257-by-250 matrix, so it is padded equally on each side with two 257-by-125 matrices of 1s by concatenating the three matrices.
To use texture mapping, set the FaceColor to texturemap and assign the imagetothesurface's CData.
load earth % Load image data, X, and colormap, map sphere; h = findobj('Type','surface'); hemisphere = [ones(257,125),... X,...
ones(257,125)]; set(h,'CData',flipud(hemisphere),'FaceColor','texturemap') colormap(map) axis equal view([90 0])
set(gca,'CameraViewAngleMode','manual') view([65 30])
1-27

pageCatalog pdf di En 2012-06-22-01