Example a/threejs_export: Exporting surfaces and displaying it with browser

Display a surface in Cmgui and exporting it into ThreeJS json file for rendering on a browser.

This example exports surfaces into ThreeJS json file which can then be rendered on a browser using the ThreeJS library. The result on ThreeJS can be viewed here.

Screenshot of example a/threejs_export


The comfile run by this example is as follows:

#Read in a mesh for export
gfx read node $example/cheese.exnode;
gfx read element $example/cheese.exelem;

gfx create window 1;

gfx modify window 1 view parallel eye_point -0.4594 -3.37366 7.69967 interest_point 0 0 0.5 up_vector 0.0625144 0.902207 0.426749 view_angle 40 near_clipping_plane 0.0796416 far_clipping_plane 28.4612 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1;

#Render the surface using spectrum
gfx modify g_element "/" surfaces domain_mesh2d coordinate coordinates tessellation default LOCAL select_on material default data xi spectrum default selected_material default_selected render_shaded;

if ($TESTING) {
	gfx export threejs file_prefix cmgui_threejs_export data_export_colour
}

Files used by this example are:

Name                        Modified     Size

example_threejs_export.com 30-Mar-2015 728 COPYRIGHT 10-Sep-2014 504 cheese.exelem 30-Mar-2015 15k cheese.exnode 10-Sep-2014 10k

Download the entire example:

Name                              Modified     Size

examples_a_threejs_export.tar.gz 09-Mar-2016 131k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureSun Mar 6 00:10:51 20162
last breakTue Mar 31 00:25:00 20152
cmgui-wx-debugFailureSun Mar 6 00:16:00 20162
last breakTue Mar 31 00:37:00 20154
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:09:58 20162
last breakTue Mar 31 00:16:00 201511
cmgui-wx-debug-valgrindFailureSun Mar 6 00:44:33 201629
last breakSun Mar 6 00:44:00 201629
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:34 20160
last breakSun Mar 6 00:01:00 20160
cmgui-wx-debugFailureSun Mar 6 00:01:35 20161
last breakSun Mar 6 00:01:00 20161
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:34 20160
last breakSun Mar 6 00:01:00 20160
cmgui-wx-debug-valgrindFailureSun Mar 6 00:02:59 20169
last breakSun Mar 6 00:02:00 20169
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:29 20167

Testing status by file:


Html last generated: Wed Mar 9 16:02:52 2016

Input last modified: Wed Mar 9 15:49:33 2016


CMISS Help / Examples / a / threejs_export