function TextBall
% 旋转的文字球:滑动鼠标,控制文字球的旋转方向
% CopyRight:xiezhh(谢中华)
% 写于2012.11.11(光棍节)
t1 = linspace(0,2*pi,21);
t1(end) = [];
t2 = linspace(-pi/2,pi/2,20);
[Theta, Pho] = meshgrid(t1,t2);
x = cos(Pho).*cos(Theta);
y = cos(Pho).*sin(Theta);
z = sin(Pho);
[data,str] = xlsread('百家姓.xls');
str = str';
str = str(1:400);
ColorMat = [jet(100);gray(100)];
id = randi(200,1,400);
surf([x,x(:,1)]/8,[y,y(:,1)]/8,[z,z(:,1)]/8,'FaceColor','r','EdgeColor','None');
camlight;
hold on;
arrayfun(@(i)text(x(i),y(i),z(i),str{i},'Color',ColorMat(id(i),:)),1:400);
axis([-1.1,1.1,-1.1,1.1,-1.1,1.1]);
axis vis3d off;
xyz1 = [-7,-7,7]; % 当前视点
se