Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.55 KB | None | 0 0
  1. %%
  2. clear all
  3. close all
  4. clc
  5.  
  6. M = load_off('tr_reg_000.off');
  7.  
  8. plot_mesh(M);
  9.  
  10. %COLORMAP MODIFICATA
  11.  
  12. n = 100
  13.  
  14. red = [linspace(0, 1, n/2)', ones(1, n/2)'];
  15. green = [linspace(0, 1, n/2)', linspace(1, 0, n/2)'];
  16. blue = [ones(1, n/2)', linspace(1, 0, n/2)'];
  17.  
  18. bluewhitered = [red(:), green(:), blue(:)];
  19.  
  20. colormap (bluewhitered)
  21.  
  22. %DRAW
  23.  
  24. axis equal
  25.  
  26. shading interp
  27.  
  28.  
  29. camlight head
  30. lighting gouraud
  31.  
  32. drawnow
  33.  
  34.  
  35. %CALCOLO DISTANZA EUCLIDEA
  36.  
  37. for i = 1:1:size(M.VERT, 1)
  38.     d = mean(pdist2(M.VERT(i), M.VERT(:), 'euclidean'));
  39.    
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement