Yang7879 / 3D-RecGAN-extended

🔥3D-RecGAN++ in Tensorflow (TPAMI 2018)
https://arxiv.org/abs/1802.00411
MIT License
132 stars 29 forks source link

Meshgrid for 3D shapes #16

Open samomin46 opened 4 years ago

samomin46 commented 4 years ago

Hi there,

I am trying to plot the .mat file using meshgrid but output is blank. I would like to visualize the 3D shapes. You did it in the paper. Would you mind sharing code? if not could you please share anything which can help. Thnx.

Yang7879 commented 4 years ago

Hi @samomin46 , in the paper, I use matlab to visualize the 3D voxel. Here's the code. Hope it's helpful for your research.

function mesh(vol)
    threshold=0.5;
    [d1,d2,d3]=size(vol);
    figure;
    [x,y,z]=meshgrid(1:1:d1,1:1:d2,1:1:d3);
    p1=patch(isosurface(x,y,z,vol,threshold,'noshare'));
    isonormals(x,y,z,vol,p1);
    p1.FaceColor = 'red';
    p1.EdgeColor = 'none';
    camlight;
    view(3);
    lighting gouraud;
    axis equal; 
    axis off;
end