Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!postnews.google.com!19g2000hsx.googlegroups.com!not-for-mail
From:  Randy Poe <poespam-trap@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Plot an image and rotate it in 3d?
Date: Thu, 27 Sep 2007 07:45:38 -0700
Organization: http://groups.google.com
Lines: 44
Message-ID: <1190904338.383996.159820@19g2000hsx.googlegroups.com>
References: <fdgc0g$739$1@fred.mathworks.com>
NNTP-Posting-Host: 192.35.37.20
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1190904338 6923 127.0.0.1 (27 Sep 2007 14:45:38 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 27 Sep 2007 14:45:38 +0000 (UTC)
In-Reply-To: <fdgc0g$739$1@fred.mathworks.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 squid.atl.lmco.com:3128 (squid/2.5.STABLE14)
Complaints-To: groups-abuse@google.com
Injection-Info: 19g2000hsx.googlegroups.com; posting-host=192.35.37.20;
Xref: news.mathworks.com comp.soft-sys.matlab:430446



On Sep 27, 9:42 am, "David Doria" <daviddo...@gmail.com> wrote:
> I would like to have a surface in a 3d plot that is an
> image, is this possible?  For example I want to show a 3d
> line passing through a 3d plane and intersecting at a
> particular point in an image (like from a camera)
>
> does that make sense?
>
> Thanks,
>
> David

Yes. Unfortunately, HELP IMAGE says this.

"    The image object will not render at axes View angles other than
    [0 90].  To get a similar effect to rotating an image, use SURF
    with texture mapping or PCOLOR."

So I tried this little experiment:

   h=image;
   figure;g=surf(get(h,'Cdata'))

That turns the image data into Z-data. Rotate it and you'll
see the original image, but with the default color map.
Let's fix the colormap and get rid of the grid lines:

   colormap('gray')
   set(g, 'edgecolor', 'none')

and make the image a lot flatter:
   set(g, 'zdata', get(g, 'zdata') * .001)

Now a test line:
   hold on
   h1=line([0 30],[0 30],[50 -50]);
   set(h1, 'linewidth', 3)
   set(gca,'view',[-60 40])

Not perfect since the image isn't actually a flat
object, but hopefully approximates what you wanted.

             - Randy