[vtkusers] matlab surf ability?

mthorman mthorman at gmail.com
Sun Jan 4 23:05:14 EST 2009


In matlab I can send three matrics  (X,Y,Z) to surf and get a surface.

x00 x01 x02 x03 x04...
x10 x11 x12 x13 x14...
x20 x21 x22 x23 x24...
x30 x31 x32 x33 x34...

y00 y01 y02 y03 y04...
y10 y11 y12 y13 y14...
y20 y21 y22 y23 y24...
y30 y31 y32 y33 y34...

z00 z01 z02 z03 z04...
z10 z11 z12 z13 z14...
z20 z21 z22 z23 z24...
z30 z31 z32 z33 x34...

The surf function of matlab takes (x00, y00, z00), (x01, y01, z01), (x11,
y11, z11), (x10, y10, z10) and makes that one of the facets of the surface. 
It does that for all neighbors yielding the surface containing the points.  

I understand that I can recreate that rather easily for f(x,y) in VTK by
using sending the z matrix to vtkImageData and using vtkWarpScalar to
extrude the z value.  

But I want to model surfaces of rotation which are not functions.  If my
last row of y's matches my first row of y's I will get a closed surface.  

I am trying to rewrite my Matlab program so that it can be compiled and
shared with some teacher friends who could use it to help illustrate what
they are teaching.  For instance the image below is the rotation of a sin
curve about a cosine curve.  When I teach volumes of revolutions in Calc,
the students can visualize what is going on a whole lot better when we throw
pictures on the the board and can spin them around to view.

I am just not sure how to do that with vtk.  It is like vtk was designed for
a different purpose.  Can anyone help me get straightened out?  Is there not
a simple mesh function that will take the sets of points and display them as
a surface.  It is like vtk is this dynamic topography idea that you have to
stretch, pull, and push to get the shapes you want.    

Thanks

Marvin

http://www.nabble.com/file/p21272725/image.jpg 
-- 
View this message in context: http://www.nabble.com/matlab-surf-ability--tp21272725p21272725.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list