Example a/biplane: Biplane.

Creating your own glpyhs and reading in elements with different nodes in different fields. Jason Mathews NASA/Goddard Space Flight Center. I got the model from the UK VR-SIG 3D Object Archive

Screenshot of example a/biplane


The comfile run by this example is as follows:

#Example a/biplane.
#Loading in your own glyph

#Create materials for the wheels and propeller 
gfx create material wheels ambient 0 0 0 diffuse 0.22 0.28 0.22 emission 0 0 0 specular 1 1 1 alpha 1 shininess 0.84
gfx create material propeller ambient 0.72 0.17 0 diffuse 0.5 0 0 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0
gfx create material plane ambient 0.5 0.8 0.5 diffuse 0.5 0.8 0.0 emission 0 0 0 specular 0.4 0.9 0.0 alpha 1 shininess 0.7
#Read in the wavefront file as a graphics object.  If your
#wavefront obj file contains material definitions then these
#will always override the material selected in the graphical
#element.  This allows mixed material glyphs which still vary
#according to a spectrum.  In this example the main body of
#the plane is left up to the spectrum but the propeller and
#wheels are the same for every plane.
gfx read wavefront as biplane $example/biplane.obj
#instead you can draw the glyph using static graphic
gfx modify g_element "/" point glyph biplane
gfx create window hangar

#Write out the VRML2 description of the biplane.  The scene
#parameter allows you to specify a subpart of a scene using
#the dot operator to reference components.
gfx export vrml file biplane.wrl

#Don't draw static graphic version of biplane any more
gfx modify g_element "/" point glyph biplane delete
#Put the biplane into the glyph object list, if you now draw
#node_points or element_points as below or using the 
#graphical element editor the glyph "biplane" will be available
#in the chooser.  By choosing the 
gfx modify glyph biplane material none
#Read in the exnode and exelem version of this file
#The texture coordinates and coordinates are defined seperately
#in the obj format and so each element interpolates different 
#nodes for each field.  Generated from the obj using obj2ex.
gfx read nodes $example/biplane.exnode
gfx read elements $example/biplane.exelem
#Define the lines of the plane as they aren't in the file
gfx define faces egroup biplane
#View the model
gfx modify g_element "/" general clear;
gfx modify g_element biplane general clear;
gfx modify g_element biplane lines material default;
gfx mod win hangar image view_all

#Read in the wavefront file as a graphics object at other times. Note: this feature has been removed on cmgui version3.1
#gfx read wavefront as biplane $example/biplane2.obj time 1
#gfx read wavefront as biplane $example/biplane3.obj time 2
gfx read wavefront as biplane $example/biplane3.obj
gfx timekeeper default minimum 0 maximum 3 speed 8 skip_frames

#Draw points at every node and biplanes at those you have selected
#The biplanes are coloured according to the spectrum and the number of 
#the node they represent.
gfx modify spectrum default clear overwrite_colour
gfx modify spectrum default linear reverse range 1 900 extend_above extend_below rainbow colour_range 0 1 ambient diffuse component 1
gfx modify g_element biplane node_points glyph point size "0.1*0.1*0.1" centre 0,0,0 select_on material default selected_material default_selected
gfx define field plane_direction coordinate_system rectangular_cartesian scale field coordinates scale_factors -1 -1 -1
gfx modify g_element biplane node_points glyph biplane size "0.2*0.2*0.2" centre 0,0,0 orientation plane_direction scale_factors "0*0*0" draw_selected material plane data cmiss_number spectrum default selected_material default_selected
#Write out the VRML2 description of the biplane.  The scene
#parameter allows you to specify a subpart of a scene using
#the dot operator to reference components, the subset now
#refers to the graphical_element_group.  Select just one
#node so that vrml2 output isn't too large.
gfx select nodes 45
gfx export vrml file biplane2.wrl scene default

#Select a few points using the node_tool, 
#selecting too many will make the model take too long to draw.
gfx select nodes 45,48,126,318,329,366,478,492,541,667,745,749

#Set the propellers spinning
#gfx timekeeper default play

Files used by this example are:

Name            Modified     Size

biplane.com 10-Sep-2014 3.9k COPYRIGHT 17-Mar-2014 504 biplane.exelem 17-Mar-2014 267k biplane.exnode 17-Mar-2014 222k biplane.obj 17-Mar-2014 204k biplane2.obj 17-Mar-2014 353k biplane3.obj 17-Mar-2014 354k

Download the entire example:

Name                       Modified     Size

examples_a_biplane.tar.gz 09-Mar-2016 818k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureSun Mar 6 00:05:26 20161
last breakThu Sep 11 00:02:00 20140
cmgui-wx-debugFailureSun Mar 6 00:05:28 20161
last breakThu Sep 11 00:02:00 20141
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:07:06 20162
last breakThu Sep 11 00:03:00 20141
cmgui-wx-debug-valgrindFailureSun Mar 6 00:40:55 201624
last breakTue Feb 24 00:09:00 201527
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:29 20160
last breakThu Sep 11 00:02:00 20140
cmgui-wx-debugFailureSun Mar 6 00:01:29 20161
last breakThu Sep 11 00:02:00 20141
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:30 20161
last breakThu Sep 11 00:02:00 20140
cmgui-wx-debug-valgrindFailureSun Mar 6 00:04:38 201623
last breakSun Mar 6 00:04:00 201623
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:05:23 201622

Testing status by file:


Html last generated: Wed Mar 9 16:01:30 2016

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


CMISS Help / Examples / a / biplane