Example ad: Rendered eye and surrounds

This example draws an eyeball and some surrounding tissue from two 'exgobj' object files. The eyeball and the surrounds are coloured realistically. Note: "exgobj" format is no longer supported from cmgui version 3.1 onward.

Screenshot of example a/ad


The comfile run by this example is as follows:

#Example_ad: Rendered eye and surrounds
#
# This example shows a detailed eyeball which is set in a small part of the face
# which includes eyebrows and skin.
#
# "exgobj" format is no longer supported from cmgui version 3.1 onward.
#
# Run all the commands at once, then try some of the suggestions mentioned at
# the end of the example.
#
#----------
#
#Create a 3d graphics window
gfx create window                   
#
# Create the materials used to draw the eye. To view the colours individually,
# select the graphical material editor from the tools menu and all materials
# will be listed.
gfx create material irisblue AMBIENT 0 0 0 SPECULAR 0.4 0.4 0.5 DIFFUSE 0.1 0.15 0.75 SHININESS 0.5
gfx create material irisblue2 AMBIENT 0 0 0 SPECULAR 0.2 0.2 0.3 DIFFUSE 0.1 0.4 0.5 SHININESS 0.5
gfx create material sclerawhite AMBIENT 0.4 0.4 0.4 SPECULAR 0.8 0.8 0.8 DIFFUSE 0.7 0.7 0.7 SHININESS 0.8
gfx create material light_source AMBIENT 0 0 0 EMISSION 0.8 0.8 0.6 SPECULAR 0.8 0.8 0.8 DIFFUSE 0.7 0.7 0.7 SHININESS 0.8
gfx create material irisblack AMBIENT 0 0 0 SPECULAR 0.3 0.3 0.3 DIFFUSE 0.05 0.1 0.19 SHININESS 0.5
gfx create material nervered AMBIENT 0.4 0.4 0.4 SPECULAR 0.4 0.3 0.3 DIFFUSE 0.6 0.2 0.1 SHININESS 0.7
gfx create material retinaartery AMBIENT 0.4 0.2 0.1 SPECULAR 0.8 0.7 0.7 DIFFUSE 0.9 0.2 0.1 SHININESS 0.7
gfx create material retinavein AMBIENT 0.4 0.2 0.1 SPECULAR 0.8 0.7 0.7 DIFFUSE 0.9 0.0 0.2 SHININESS 0.7
gfx create material lateralred AMBIENT 0.4 .1 0.0 SPECULAR 1.0 0.0 0.1 DIFFUSE 0.4 0.0 0.05 SHININESS 0.9
gfx create material retinared AMBIENT 0.7 0.45 0.2 SPECULAR 0.2 0.1 0.1 DIFFUSE 0.75 0.35 0.1 SHININESS 0.9
gfx create material opticdiscred1 AMBIENT 0.5 0.3 0.1 SPECULAR 0.3 0.2 0.1 DIFFUSE 0.75 0.6 0.2 SHININESS 0.9
gfx create material opticdiscred2 AMBIENT 0.5 0.4 0.4 SPECULAR 0.3 0.2 0.1 DIFFUSE 0.85 0.8 0.6 SHININESS 0.9
gfx create material seethru AMBIENT 0 0 0 SPECULAR 1.0 1.0 1.0 DIFFUSE 0.15 0.15 0.3 SHININESS 0.9 ALPHA 0.2
gfx create material lens AMBIENT 0 0 0 SPECULAR 0.0 0.0 0.0 DIFFUSE 0.0 0.0 0.0 SHININESS 0.9 ALPHA 1.0
gfx create material lens2 AMBIENT 0 0 0 SPECULAR 1.0 1.0 1.0 DIFFUSE 0.4 0.4 0.6 SHININESS 0.9 ALPHA 0.4
gfx create material ora_serrata AMBIENT 0.85 0.15 0.1 SPECULAR 0.4 0.3 0.3 DIFFUSE 0.85 0.1 0.05 SHININESS 0.8
gfx create material nodematerial AMBIENT 0.5 0.3 0.2 SPECULAR 0.95 0.85 0.7 DIFFUSE 0.6 0.4 0.1 SHININESS 0.9
gfx create material skin AMBIENT 0.5 0.3 0.2 SPECULAR 0.2 0.2 0.2 DIFFUSE 0.95 0.6 0.35 SHININESS 0.1
gfx create material yukky AMBIENT 0.7 0.6 0.6 SPECULAR 1.0 1.0 1.0 DIFFUSE 1.0 0.6 0.5 SHININESS 0.9
gfx create material hairmaterial AMBIENT 0 0 0 SPECULAR 0.7 0.7 0.7 DIFFUSE 0.1 0.1 0.1 SHININESS 0.9
gfx create material metal AMBIENT 0.4 0.4 0.5 SPECULAR 1.0 1.0 1.0 DIFFUSE 0.7 0.7 0.8 SHININESS 0.9
gfx create material eyewindow AMBIENT 1.0 1.0 1.0 SPECULAR 1.0 1.0 1.0 DIFFUSE 1.0 1.0 1.0 SHININESS 0.9
gfx create spectrum rgb clear overwrite_colour
gfx modify spectrum rgb linear range 0 255 extend_above extend_below red colour_range 0 1 ambient diffuse component 1
gfx modify spectrum rgb linear range 0 255 extend_above extend_below green colour_range 0 1 ambient diffuse component 2
gfx modify spectrum rgb linear range 0 255 extend_above extend_below blue colour_range 0 1 ambient diffuse component 3
#
#Change the direction of the default light:
gfx modify light default dir 0 -0.5 -1
#
# Give the graphics window a better background colour for this model:
gfx mod win 1 background colour 0 0.1 0.2
#
# Set the point we want to look at to be 100 units out in the -z direction,
# along with other viewing parameters:
gfx mod win 1 view eye_point 0 0 -100 near 1 far 150 up_vector 0 -1 0 view_angle 30
#
#Read in the objects which make up the eye ball
gfx read objects example eye.exgobj
#
#Read in the objects which make up the rest of the face and hair
gfx read objects example eyebrowface.exgobj
#
#Set the spectrum on those that need it
gfx mod glyph optic_disc spectrum rgb
gfx mod glyph pupillary_zone spectrum rgb
gfx mod glyph ciliary_zone spectrum rgb
gfx mod glyph collarette spectrum rgb

#Create region the objects which make up the face
gfx create region hairmorph
gfx modify g_element hairmorph point glyph hairmorph
gfx create region facemorph
gfx modify g_element facemorph point glyph facemorph
gfx create region caruncle
gfx modify g_element caruncle point glyph caruncle
gfx create region eyebrow
gfx modify g_element eyebrow point glyph eyebrow
#Create Region and draw the objects which make up the eyeball 
gfx create region optic_disc
gfx modify g_element optic_disc point glyph optic_disc
gfx create region retina1
gfx modify g_element retina1 point glyph retina1
gfx create region retina2
gfx modify g_element retina2 point glyph retina2
gfx create region exterior_vessels
gfx modify g_element exterior_vessels point glyph exterior_vessels
gfx create region pupillary_zone
gfx modify g_element pupillary_zone point glyph pupillary_zone
gfx create region ciliary_zone
gfx modify g_element ciliary_zone point glyph ciliary_zone
gfx create region collarette
gfx modify g_element collarette point glyph collarette
gfx create region iris_background
gfx modify g_element iris_background point glyph iris_background
gfx create region sclera
gfx modify g_element sclera point glyph sclera
gfx create region lens
gfx modify g_element lens point glyph lens
gfx create region lens2
gfx modify g_element lens2 point glyph lens2
gfx create region cornea
gfx modify g_element cornea point glyph cornea
gfx create region optic_nerve
gfx modify g_element optic_nerve point glyph optic_nerve
gfx create region ora_serrata
gfx modify g_element ora_serrata point glyph ora_serrata
#
gfx create region retinal_artery0
gfx modify g_element retinal_artery0 point glyph retinal_artery0
gfx create region retinal_artery0.5
gfx modify g_element retinal_artery0.5 point glyph retinal_artery0.5
gfx create region retinal_artery1
gfx modify g_element retinal_artery1 point glyph retinal_artery1
gfx create region retinal_artery2
gfx modify g_element retinal_artery2 point glyph retinal_artery2
gfx create region retinal_vein1
gfx modify g_element retinal_vein1 point glyph retinal_vein1
gfx create region retinal_vein2
gfx modify g_element retinal_vein2 point glyph retinal_vein2
gfx create region lateral_vessels
gfx modify g_element lateral_vessels point glyph lateral_vessels
gfx create region light_source
gfx modify g_element light_source point glyph light_source
gfx create region window
gfx modify g_element window point glyph window
#
# Note that the 'export graphics objects' read in by this example are of an old
# format that included a transformation matrix. CMGUI now allows a separate
# transformation matrix each time an object is drawn so the matrix is no longer
# a property of the raw object itself. As a result, CMGUI will ask you to enter
# these transformations with the 'gfx set transformation command'. This is
# already done for you by the following, so ignore the warning messages.
gfx set transformation name retinal_artery0 0.012218 -0.998630 -0.050890 0.000000 0.972370 0.000000 0.233445 0.000000 -0.233125 -0.052336 0.971037 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name retinal_artery0.5 -0.008147 -0.999391 0.033935 0.000000 0.972370 0.000000 0.233445 0.000000 -0.233303 0.034899 0.971778 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name retinal_artery1 0.000000 -1.000000 0.000000 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258819 0.000000 0.965926 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name retinal_artery2 0.000000 -1.000000 0.000000 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258819 0.000000 0.965926 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name retinal_vein1 0.021085 -0.996195 -0.084567 0.000000 0.970296 0.000000 0.241922 0.000000 -0.241001 -0.087156 0.966603 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name retinal_vein2 -0.018054 -0.997564 0.067380 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258189 0.069756 0.963573 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name lateral_vessels 0.000000 -1.000000 0.000000 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258819 0.000000 0.965926 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name optic_disc 0.000000 -1.000000 0.000000 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258819 0.000000 0.965926 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name retina1 0.000000 -1.000000 0.000000 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258819 0.000000 0.965926 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name lens 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -8.500000 1.000000
gfx set transformation name lens2 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -8.500000 1.000000
gfx set transformation name cornea 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -5.100000 1.000000
gfx set transformation name window 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -5.100000 1.000000
gfx set transformation name optic_nerve 0.000000 -1.000000 0.000000 0.000000 0.965926 0.000000 0.258819 0.000000 -0.258819 0.000000 0.965926 0.000000 -2.898773 0.000000 10.818369 1.000000
gfx set transformation name eyebrow 1.600000 0.000000 0.000000 0.000000 0.000000 -1.600000 0.000000 0.000000 0.000000 0.000000 -1.600000 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name hairmorph 1.600000 0.000000 0.000000 0.000000 0.000000 -1.600000 0.000000 0.000000 0.000000 0.000000 -1.600000 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name facemorph 1.600000 0.000000 0.000000 0.000000 0.000000 -1.600000 0.000000 0.000000 0.000000 0.000000 -1.600000 0.000000 0.000000 0.000000 0.000000 1.000000
gfx set transformation name caruncle 0.230000 0.000000 0.000000 0.000000 0.000000 -0.140000 0.000000 0.000000 0.000000 0.000000 -0.140000 0.000000 -9.500000 1.700000 -8.550000 1.000000
#
# You can toggle the visibility of various parts of the model by double clicking
# on these commands.
gfx set vis hairmorph
gfx set vis facemorph
gfx set vis caruncle
gfx set vis eyebrow
gfx set vis optic_disc
gfx set vis retina1
gfx set vis retina2
gfx set vis exterior_vessels
gfx set vis pupillary_zone
gfx set vis ciliary_zone
gfx set vis collarette
gfx set vis iris_background
gfx set vis sclera
gfx set vis lens
gfx set vis lens2
gfx set vis cornea
gfx set vis optic_nerve
gfx set vis ora_serrata
gfx set vis retinal_artery0
gfx set vis retinal_artery0.5
gfx set vis retinal_artery1
gfx set vis retinal_artery2
gfx set vis retinal_vein1
gfx set vis retinal_vein2
gfx set vis lateral_vessels
gfx set vis light_source
gfx set vis window
#
# Since the above commands make all objects invisible, we now individually turn
# on the exterior parts of the eye and its surrounds. At the end of this example
# you may wish to make some or all of the following invisible and turn on such
# interior features such as the retinal arteries and veins.
gfx set vis hairmorph
gfx set vis facemorph
gfx set vis caruncle
gfx set vis eyebrow
gfx set vis retina2
gfx set vis exterior_vessels
gfx set vis pupillary_zone
gfx set vis ciliary_zone
gfx set vis collarette
gfx set vis iris_background
gfx set vis sclera
gfx set vis lens
gfx set vis cornea
#
# Incorporated in this example are time aware graphics objects in the eye.
# You can slide the time_slider in the graphics window to make the eye dilate.
#
# Set the command prompt to 'gfx'.
gfx timekeeper default min 0 max 3

gfx
#
#----------
#

Files used by this example are:

Name                Modified     Size

example_ad.com 10-Sep-2014 11k COPYRIGHT 17-Mar-2014 504 eye.exgobj 17-Mar-2014 2.4M eyebrowface.exgobj 17-Mar-2014 30k

Download the entire example:

Name                  Modified     Size

examples_a_ad.tar.gz 09-Mar-2016 1.3M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureWed Sep 10 00:06:14 20142
last breakTue Aug 26 01:05:00 20144
cmgui-wx-debugFailureWed Sep 10 00:05:55 20142
last breakTue Aug 26 01:05:00 20143
cmgui-wx-debug-memorycheckFailureWed Sep 10 00:07:07 20142
last breakTue Aug 26 01:05:00 20144
cmgui-wx-debug-valgrindFailureWed Sep 10 01:06:33 201453
last breakMon Aug 25 16:50:00 2014142
x86_64-linux
cmgui-wxFailureWed Sep 10 00:03:47 20141
last breakFri Aug 15 00:04:00 20141
cmgui-wx-debugFailureWed Sep 10 00:03:47 20140
last breakFri Aug 15 00:04:00 20141
cmgui-wx-debug-memorycheckFailureWed Sep 10 00:04:15 20141
last breakFri Aug 15 00:04:00 20141
cmgui-wx-debug-valgrindFailureWed Sep 10 00:32:07 201438
last breakFri Aug 15 00:04:00 201438
cmgui-wx-gcc-cad-debug-valgrindSuccessWed Sep 10 00:30:26 201436

Testing status by file:


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

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


CMISS Help / Examples / a / ad