How to plot a coloured surface from 3d scatter

August 10, 2009 by Luigi Giaccari 
Filed under: Graphics, Tutorials 
Leave a Comment
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)
VN:F [1.8.1_1037]
Rating: 0.0/10 (0 votes cast)

Coloured surface

This submission is for Matlab beginners.

After I post my tools on surface recostruction I received many e-mails of people asking what is the best way to get a surface from 3D scatter.
Most of them (about 90%), show to me surfaces in the z=f(x,y) form.

File exchange offers many alternative in this case, one of them is John D’Errico’s gridfit that returns very smooth and good looking surfaces.

My tools for surface recostruction are designed for the more general, and of course complicate, case when the surface is not in the z=f(x,y). Unfortunatly they are not reliable as gridfit or the method I am going to show. So in this easier case I would avoid to use my other submissions.

The easiest way to get the surface is to first get a triangulation using only x and y coordinates than using the trisurf command. This is very useful when we have to associate each point a color value.

Differently from grid fitting methods, all points will be part of the surface, all we need to do is to build a colormap (points—>rgb triplet)  to get a good looking surface. Matlab rendering tools will doe the rest of the job.

The disavantage is generally it needs more points to have a good representing surface. The surface may also be more sensible to noise and sometimes may look more rough.

See the script and look how easy it is!!

Foor info,questions, suggestions:

giaccariluigi@msn.com

Download Now

VN:F [1.8.1_1037]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)

Popularity: 51% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • PDF
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • MySpace
  • RSS

Related Posts

Comments

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


Include MATLAB code in your comment by doing the following:

<pre lang="MATLAB">

%insert code here

</pre>