Info

This question is closed. Reopen it to edit or answer.

Figure with image mapped to spherical background

1 view (last 30 days)
Daire Vickers
Daire Vickers on 11 May 2021
Closed: Daire Vickers on 12 May 2021
Hi, I am trying to make a 3-D plot which has a spherical background image. I have tried making a larger sphere that an image is mapped to, and then placing the other data to be plotted inside this sphere, and placing the camera inside the sphere. However when I do this the the figure displays as a circle, rather than the background image filling up the whole square area of the figure.
I have:
and my code is:
axis([-10 10 -10 10 -10 10])
[x,y,z]=sphere(50);
spherescale=10;
hold on
U_im=imread('esoMilkyway.jpg'); % Import texture data for Universe
Bg=surf((x*spherescale),(y*spherescale), (z*spherescale));
set(Bg,'facecolor','texturemap','cdata',U_im,'edgecolor','none');
daspect([1 1 1]);
campos([1 0 0]);
axis off
The effect that I am trying to reproduce can be seen at 20:45 in this video: https://uk.mathworks.com/videos/modeling-and-simulation-with-matlab-a-case-study-in-problem-based-learning-90422.html
Also, when I rotate the figure the camera moves itself out of the sphere which is also something I would like to stop happening. If anyone can help me out that would be greatly appreciated.

Answers (0)

This question is closed.

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!