help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Plot an image in 3D using surf function.


From: Cristóbal Alvarado Minic
Subject: Re: Fwd: Plot an image in 3D using surf function.
Date: Sun, 8 Sep 2013 13:52:18 -0430

Hi Jason, thank you for your answer. I am still getting the error:

octave:1> xlabel('x');
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having multiple values in <test> isn't supported and may not work as expected
octave:2> ylabel('y');
octave:3> zlabel('z');
octave:4> img = imread('1.jpg');     %# Load a sample image
warning: your version of GraphicsMagick limits images to 8 bits per pixel
octave:5> xImage = [-0.5 0.5; -0.5 0.5];   %# The x data for the image corners
octave:6> yImage = [0 0; 0 0];             %# The y data for the image corners
octave:7> zImage = [0.5 0.5; -0.5 -0.5];   %# The z data for the image corners
octave:8> surf(xImage,yImage,zImage,...    %# Plot the surface
>      'CData',img,...
>      'FaceColor','texturemap');
error: __go_draw_axes__: invalid grid data
error: called from:
error:   /usr/share/octave/3.6.4/m/plot/private/__go_draw_axes__.m at line 1143, column 15
error:   /usr/share/octave/3.6.4/m/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /usr/share/octave/3.6.4/m/plot/__gnuplot_drawnow__.m at line 86, column 5
octave:9> 

I'm using GNU Octave 3.6.4 under Debian Sid.

I managed to do what I wanted using this syntax:

view(150,50);
colormap(gray(256));
axis("auto");
axis("off");

img1=imread('1.jpg');
img2=imread('2.jpg');
img3=imread('3.jpg');

hold on;
surf(0*ones(length(img1),columns(img1)), 'cdata', double(fliplr(img1)),'EdgeColor','none');
surf(10*ones(length(img2),columns(img2)), 'cdata', double(fliplr(img2)),'EdgeColor','none');
surf(20*ones(length(img3),columns(img3)), 'cdata', double(fliplr(img3)),'EdgeColor','none');
hold off;

Sincerely,

Chris.





2013/9/8 JasonNicholson <address@hidden>
I think the main issue is your missing the FaceColor option from your call to
surf.  Change your call to surf to this:

surf(xImage,yImage,zImage, 'CData',img, 'FaceColor','texturemap');

sincerely,
Jason Nicholson



--
View this message in context: http://octave.1599824.n4.nabble.com/Plot-an-image-in-3D-using-surf-function-tp4657126p4657142.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]