Code covered by the BSD License  

Highlights from
3D Surface/Mesh to VRML Utility: mesh2vrml 1.0

Be the first to rate this file! 19 Downloads (last 30 days) File Size: 48.2 KB File ID: #28014
image thumbnail

3D Surface/Mesh to VRML Utility: mesh2vrml 1.0

by

 

Convert MATLAB 3D surface to ElevationGrid in VRML

| Watch this File

File Information
Description

This submission is inspired by a newsgroup thread here:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/284930

The input is a m x n X-Y grid (equal intervals along both axes) with the value of Z(x,y) computed at each point as an input to the function. The output is a elevation.wrl VRML file that creates a ElevationGrid node with the appropriate coordinates.

Launch the startmeup.m file to do the conversion. Several surfaces are provided as example.

Since this is a version 1.0, several limitations exist and is open to improvement from the community:
1. The number of polygons are not optimized for the VRML. It simply operates on the same number of points provided.
2. The mesh grid defining the X-Y plane in MATLAB need to have equispaced intervals.
3. Z(x,y) needs to be computed by scanning along row X first and then for row Y.
4. No coloring information.

Note that the orientation of the reference frame in MATLAB needs to undergo change to conform to the VRML reference frame. (X->x, Z->y, Y->z)
 
Use the Scale node in the Tranform node of the VRML file to increase/decrease the size of the elevation grid. You can also texture it with an image to create landscapes.

You will need V-Realm Builder that ships with Simulink 3D Animation to view and edit the VRML file.

More information on the VRML ElevationGrid is here:

http://www.lighthouse3d.com/vrml/tutorial/index.shtml?elevg

Required Products Simulink 3D Animation
MATLAB release MATLAB 7.10 (R2010a)
Other requirements You will need V-Realm Builder that ships with Simulink 3D Animation to view and edit the VRML file.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us