Correct usage/explanation of trisurf
Show older comments
Hi all,
I'm trying to get a 3D representation of a pixel-by-pixel depth map. I have a matrix which specifies the locations of triangle vertices and the index of the triangle it belongs to(so, as I see it, x & y). It looks something like this:
1 1 3 3
1 0 2 3
0 2 2 0 where 0 means the pixel is unallocated to a triangle
and another matrix of the same size which has the depth of each vertex (the z). I've been creating my mx3 triangle matrix using the index of each triangle. I put this into trisurf with a meshgrid for the x and y, and the depths for z, and I get a (to quote Full Metal Jacket) "modern art masterpiece" with triangles all over the place.
Can any one give me a tip on how to transform the x&y index matrix into a usable mx3 triangle matrix? A bit of background onto how the image is actually constructed from the mx3 and the x/y/z matrices would also be really handy.
Cheers, Andrew
Answers (0)
Categories
Find more on Triangulations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!