3D‎ > ‎

MATLAB 3D


  Subpage


 

Export MATLAB 3D data

                3d data generated in MATLAB can be exported to a number of 3d data format . MATLAB file exchange have a number of submissions which can export data
in VRML,OBJ,STL and other file formats.MATLAB surface is made up of number of small patches . To get these patches one can use function surf2patch().This function will convert x,y,z data to face and vertex data.Face data is a m-by-4 array , it means every patch of the surface is made by connecting four vertex .Vertex is a n-by-3 array. Each row of vertex array is a 3d point of surface . 
  • Export MATLAB surface to OBJ file

This MATLAB code can be used to export MATLAB 3d surface to Wavefront OBJ file.The OBJ file will contain only vertex and face data of the surface.Example to explain how to use this function.

[x,y,z]=peaks;
surf2OBJ(x,y,z,'OBJfileName'); %OBJfileName.obj will be created

download surf2OBJ







  • Export MATLAB surface to POV-Ray mesh

 This MATLAB code can be used to export MATLAB 3d surface to POV-Ray mesh.The POV-Ray file will contain only vertex and face data of the surface.Example to explain how to use this function.More detailed explanation is given in surf2PovMesh.m file

[x,y,z]=peaks;
surf2PovMesh(x,y,z,'povMeshName.pov'); %povMeshName.pov will be created

download  surf2PovMesh  .