MATLAB Plots *.tif According to Light
Hi,
I am trying to plot a lunar terrain from a *.stl file. You can see the real image and plot in photos. MATLAB is plotting the deepest place as dark blue, the highest as yellow, but the thing is MATLAB’s dark blue is not actually the deepest place, it is just shadow, likewise MATLAB’s yellow actually isn’t the highest place, it just takes the most light so its brighter. This is my code snippet to plot it. My real aim is to create a simulation, therefore I need the surface model.
[dem, ~] = readgeoraster(‘moon1m-a.tif’);
gridSize = 3900;
start = 1;
[X, Y] = meshgrid(1:gridSize, 1:gridSize);
Z = dem(start:start+gridSize-1, start+gridSize-1:-1:start);
figure
mesh(X, Y, Z);
Images are aligned, you can see the shadow places at the bottom right.
I can’t put the file into the attachments, it is too big even after compressing. I can put the *.tif into a 3D drawing tool, this is the output.
Any help would be appreciated.
Thanks in advance.Hi,
I am trying to plot a lunar terrain from a *.stl file. You can see the real image and plot in photos. MATLAB is plotting the deepest place as dark blue, the highest as yellow, but the thing is MATLAB’s dark blue is not actually the deepest place, it is just shadow, likewise MATLAB’s yellow actually isn’t the highest place, it just takes the most light so its brighter. This is my code snippet to plot it. My real aim is to create a simulation, therefore I need the surface model.
[dem, ~] = readgeoraster(‘moon1m-a.tif’);
gridSize = 3900;
start = 1;
[X, Y] = meshgrid(1:gridSize, 1:gridSize);
Z = dem(start:start+gridSize-1, start+gridSize-1:-1:start);
figure
mesh(X, Y, Z);
Images are aligned, you can see the shadow places at the bottom right.
I can’t put the file into the attachments, it is too big even after compressing. I can put the *.tif into a 3D drawing tool, this is the output.
Any help would be appreciated.
Thanks in advance. Hi,
I am trying to plot a lunar terrain from a *.stl file. You can see the real image and plot in photos. MATLAB is plotting the deepest place as dark blue, the highest as yellow, but the thing is MATLAB’s dark blue is not actually the deepest place, it is just shadow, likewise MATLAB’s yellow actually isn’t the highest place, it just takes the most light so its brighter. This is my code snippet to plot it. My real aim is to create a simulation, therefore I need the surface model.
[dem, ~] = readgeoraster(‘moon1m-a.tif’);
gridSize = 3900;
start = 1;
[X, Y] = meshgrid(1:gridSize, 1:gridSize);
Z = dem(start:start+gridSize-1, start+gridSize-1:-1:start);
figure
mesh(X, Y, Z);
Images are aligned, you can see the shadow places at the bottom right.
I can’t put the file into the attachments, it is too big even after compressing. I can put the *.tif into a 3D drawing tool, this is the output.
Any help would be appreciated.
Thanks in advance. 3d plots, plot, mesh, figure MATLAB Answers — New Questions