Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

Text On Sphere - MATLAB CODE


Text on Sphere-MATLAB CODE

              We can see how to wrap a text around a sphere. First obtain the x,y and z co-ordinates of  the sphere.These co-ordinates can be used as an input for surface object.

Surface object generates sphere using the co-ordinates.  Example:[x,y,z]=sphere(25); surface(x,y,z);
Now read a text image and convert it into binary.  Label the components in the image. You can also check how to label components without BWLABELfunction in MATLAB.   Now use the labeled image as a CDATA value in surface object.

Example: surface(x,y,z, ‘CDATA’,matrix);

MATLAB CODE:
%Input a text image
A=imread('quotes.png');
         

A=~im2bw(A);
B=bwlabel(A,8);
F=double(B);
mytext=flipud(F);


% Create the surface.
[x,y,z] = sphere(100);


figure,surface(x,y,z,'CData',mytext,'FaceColor','texturemap','FaceLighting','phong','EdgeLighting','phong','EdgeColor','none');
%set the colormap. Some built-in colormaps are pink, copper, jet, hot...
colormap pink;


%Create light object
light('position',[1 2 0 ],'Style','infinite','color',[0.8 0.7 0.8]);
light('position',[-2 -3 0 ],'color',[0.8 0.7 0.8]);


%Specify the viewpoint
axis square off
view(12,0);






Another Example: To create a GLOBE from a WORLD MAP







0 comments:

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.