[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: matlab code 2 gnu octave help, 3d plot
From: |
Terry Duell |
Subject: |
Re: matlab code 2 gnu octave help, 3d plot |
Date: |
Fri, 01 Nov 2013 14:56:03 +1100 |
User-agent: |
Opera Mail/12.16 (Linux) |
On Fri, 01 Nov 2013 11:54:04 +1100, thor36 <address@hidden> wrote:
Hello
I have a problem trying to convert a piece of Matlab code to make it run
in
GNU Octave.
The files are here:
https://www.dropbox.com/sh/fimaodh2g8v1h98/EJTdf18IJC
The source code is in topotest.m , and I would like to see a 3D plot of
planet Earth in Octave, with all the options of axis setting and rotating
the view.
There are a few issues with this code. I don't know enough to be able to
get it do what you want, and not sure if that's possible.
I can however get a 3D plot, by making a few modifications to
"topotest.m", as follows;
% Create the surface.
%[x,y,z] = sphere(50);
[x,y,z] = sphere(179);
props.AmbientStrength = 0.1;
props.DiffuseStrength = 1;
props.SpecularColorReflectance = .5;
props.SpecularExponent = 20;
props.SpecularStrength = 1;
props.FaceColor= 'texture';
props.EdgeColor = 'none';
props.FaceLighting = 'phong';
props.Cdata = topo;
%surface(x,y,z,props);
surface(x,y,z,topo(:,1:180));
% Add lights.
%light('position',[-1 0 1]);
%light('position',[-1.5 0.5 -0.5], 'color', [.6 .2 .2]);
% Set the view.
axis square off
view(3)
pause
This may get you started, but nowhere near what you wanted.
Cheers,
--
Regards,
Terry Duell