Path: news.mathworks.com!not-for-mail
From: "Vihang Patil" <vihang_patil@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: HELP reading JPG and plotting image in 3D
Date: Tue, 18 Mar 2008 12:34:01 +0000 (UTC)
Organization: Konem Solutions
Lines: 47
Message-ID: <frocrp$cp8$1@fred.mathworks.com>
References: <Pine.LNX.4.64.0803171321000.23534@tsunami.ocean.washington.edu>
Reply-To: "Vihang Patil" <vihang_patil@yahoo.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1205843641 13096 172.30.248.35 (18 Mar 2008 12:34:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Mar 2008 12:34:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 413701
Xref: news.mathworks.com comp.soft-sys.matlab:457807


Skip Albertson <alberts@ocean.washington.edu> wrote in 
message 
<Pine.LNX.4.64.0803171321000.23534@tsunami.ocean.washington
.edu>...
> Can anyone tell me the best way to read an image:
> 
> A=imread('pic.jpg');
> 
> and then plot it in a 3D space specifying the vertices.
> 
> If my workspace has x:0-100, y:0-100, and z:0-100 and I 
want to paste my 
> JPEG image so that the corners are placed at:
> 
> lower left: x=25, y=25, z=0
> upper left: x=25, y=25, z=100
> upper right: x=75, y=75, z=100
> lower right: x=75, y=75, z=0
> 
> view(3)
> 
> How would I best do that?
> 
> Thanks!
> 
> 

Try this

load clown
C = X;
X = [0 0; 1 1];
Y = [1 1; 1 1];
Z = [0 1; 0 1];
surface(X,Y,Z,rot90(flipud
(C)),'FaceColor','texturemap','EdgeColor','none','CDataMapp
ing','direct')
view(3)
colormap(map)
cameratoolbar
set(gcf,'color','k');
axis off;
axis vis3d;


HTH
Vihang