Matlab 3D figure to 3D (X)HTML

버전 1.9.0.0 (436 KB) 작성자: Dirk-Jan Kroon
Converts 3D objects of a Matlab figure to XHTML embedded X3D file. Interactive 3D website graphics.
다운로드 수: 4K
업데이트 날짜: 2011/8/17

라이선스 보기

편집자 메모: This file was selected as MATLAB Central Pick of the Week

This function FIGURE2XHTML converts the 3D objects of a Matlab figure to an in XHTML embedded X3D file. In a modern browser, you can then view your figure interactively because of the great X3DOM Library (Instant 3D the HTML way! http://www.x3dom.org/).

Currently the function supports: Axes, Patch, Line, Surface, Text, Images and Light Objects.

Note: Even volume rendering in your browser is possible, by using: http://www.mathworks.com/matlabcentral/fileexchange/19155-volume-render

Browsers supported:
- Google Chrome 9.x and above
- Firefox 4.x and above
- Webkit nightly builds
- Flash11 needed for Internet explorer (or InstantReality-plugin)


figure2xhtml(filename,handle,options)

Note : All input arguments are optional, and sorting doesn't matter
thus figure2xhtml(); is valid but also figure2xhtml(options,handle);

inputs,
filename : Name of the XHTML file (also an X3D file is created).
When empty or not known a File-Dialog is shown
handle : Figure handle or axis handle
When empty or not known the current axis (GCA) is used
options : A struct with options
options.output : Produce output files 'x3d', 'xhtml' or 'both' (default)
options.width : Width of X3D render object in pixels default 500
options.height : Height of X3D render object in pixels default 500
options.headlight : Enable Camera head light, boolean true/false
(default true)
options.title : Title of xhtml page, default 'Matlab X3D'
options.interactive : Make mesh/surface objects clickable in xhtml,
boolean true/false (default false)



Example,
load('functions\exampledata');
figure, hold on; axis equal;
patch(FV,'facecolor',[1 0 0],'facealpha',0.5);
FV.vertices(:,1)=FV.vertices(:,1)+80;
patch(FV,'FaceColor','interp','FaceVertexCData',rand(size(FV.vertices)),'edgecolor','none');
FV.vertices(:,1)=FV.vertices(:,1)+80;
patch(FV,'FaceColor','flat','FaceVertexCData',rand(size(FV.faces)),'edgecolor','none');
figure2xhtml('test/example1')

인용 양식

Dirk-Jan Kroon (2024). Matlab 3D figure to 3D (X)HTML (https://www.mathworks.com/matlabcentral/fileexchange/32207-matlab-3d-figure-to-3d-x-html), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.9.0.0

Improved Internet Explorer support

1.8.0.0

Added options

1.7.0.0

added alphamap support

1.6.0.0

Added images support.
Added reverse axis support.

1.5.0.0

Added Line-Marker support

1.4.0.0

Font-size adjustment

1.2.0.0

added text support, and example with axis in xhtml.

1.1.0.0

- Added Surface Texture Support
- Fixed NaN bug in vertex-normals

1.0.0.0