Example a_backup/testing/torso_groups: Tests the node/element group behaviour.


The comfile run by this example is as follows:

# Torso test example. Reads in one large node file, and separate element files
# for each layer in the torso. Tests the node/element group behaviour, incl.
# making a special element group showing part of the torso.

# reduce surface quality for smaller vrml output
gfx define tessellation default minimum_divisions "1" refinement_factors "2";

# Create some materials to be given to surfaces of the various torso parts.
# Yellow axes:
gfx create material axes ambient 1 1 0 diffuse 1 1 0 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0 texture none;
# Translucent yellow fat:
gfx create material fat ambient 1 1 1 diffuse 0.9 0.7 0 emission 0 0 0 specular 0 0 0 alpha 0.4 shininess 0 texture none;
# Red heart:
gfx create material heart ambient 1 1 1 diffuse 1 0 0 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0 texture none;
# Slightly pink lungs:
gfx create material lungs ambient 1 1 1 diffuse 0.9 0.3 0.3 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0 texture none;
# Translucent red muscle:
gfx create material muscle ambient 1 1 1 diffuse 1 0.1 0 emission 0 0 0 specular 0 0 0 alpha 0.5 shininess 0 texture none;
# Translucent grey torso:
gfx create material torso ambient 1 1 1 diffuse 0.7 0.7 0.7 emission 0 0 0 specular 0 0 0 alpha 0.3 shininess 0 texture none;

# Draw global axes in the root region's rendition
gfx modify g_element "/" general clear;
gfx modify g_element "/" point as axes glyph axes general size "100.0*100.0*100.0" centre 0,0,0 font default select_on material axes selected_material default_selected;

# Read in the nodes and elements.
gfx read elem example body_fat.exelem
gfx read elem example body_heart.exelem
gfx read elem example body_llung.exelem
gfx read elem example body_muscle.exelem
gfx read elem example body_rlung.exelem
gfx read elem example body_torso.exelem

# Establish lines for the groups:
gfx modify g_element heart lines coordinate coordinates material default
gfx modify g_element llung lines coordinate coordinates material default
gfx modify g_element rlung lines coordinate coordinates material default
gfx modify g_element muscle lines coordinate coordinates material default
gfx modify g_element fat lines coordinate coordinates material default
gfx modify g_element torso lines coordinate coordinates material default

# Establish surfaces in the right materials for the groups:
gfx modify g_element heart surfaces coordinate coordinates material heart
gfx modify g_element llung surfaces coordinate coordinates material lungs
gfx modify g_element rlung surfaces coordinate coordinates material lungs
gfx modify g_element muscle surfaces coordinate coordinates material muscle
gfx modify g_element fat surfaces coordinate coordinates material fat
gfx modify g_element torso surfaces coordinate coordinates material torso
# Create a teletubby element group:
gfx create egroup teletubby region torso;
gfx modify egroup torso/teletubby add 755 756,765..768,777..780,789..792,801..804,813..816,825 826
# Draw surface with a colourful spectrum to the tellytubby!
gfx modify g_element torso/teletubby general clear;
gfx define field torso/mag magnitude field coordinates
gfx modify g_element torso/teletubby surfaces coordinate coordinates position 1 material default data mag spectrum default
gfx modify spectrum default autorange;

# Reorder the groups for fast OpenGL alpha blending to work properly.
gfx set order region heart before torso;
gfx set order region llung before torso;
gfx set order region rlung before torso;
gfx set order region muscle before torso;
gfx set order region fat before torso;

# Export the resulting image to vrml, without axes
gfx modify g_element "/" point as axes invisible;
gfx export vrml file tele_torso.wrl
gfx modify g_element "/" point as axes visible;

Files used by this example are:

Name                Modified     Size

torso_groups.com 20-Apr-2012 3.7k COPYRIGHT 19-Apr-2012 504 body_fat.exelem 20-Apr-2012 204k body_heart.exelem 20-Apr-2012 24k body_llung.exelem 20-Apr-2012 63k body_muscle.exelem 20-Apr-2012 203k body_rlung.exelem 20-Apr-2012 63k body_torso.exelem 20-Apr-2012 204k

Download the entire example:

Name                                           Modified     Size

examples_a_backup_testing_torso_groups.tar.gz 12-Aug-2014 701k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:06:48 20161
cmgui-wx-debugSuccessSun Mar 6 00:06:49 20161
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:06:49 20161
cmgui-wx-debug-valgrindSuccessSun Mar 6 00:41:40 201623
x86_64-linux
cmgui-wxSuccessThu Jan 7 00:01:31 20161
cmgui-wx-debugSuccessThu Jan 7 00:01:31 20161
cmgui-wx-debug-memorycheckSuccessThu Jan 7 00:01:31 20161
cmgui-wx-debug-valgrindFailureSun Mar 6 00:04:12 201620
last breakSun Mar 6 00:03:00 201620
last successWed Jun 3 00:17:00 201519
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:05:08 201617

Testing status by file:


Html last generated: Sun Mar 6 05:51:02 2016

Input last modified: Fri Apr 20 16:01:49 2012


CMISS Help / Examples / a_backup / testing / torso_groups