The Materials and Geometry Format

Version 1.0, May 1995

Greg Ward, Lawrence Berkeley Laboratory, GJWard@Lbl.Gov

Introduction

What makes MGF special?

What does MGF look like?

MGF's place in the world of standards

MGF Basics

Entities and Contexts

Hierarchical Contexts and Transformations

Detailed MGF Example

MGF Entity Reference

There are currently 28 entities in the MGF specification. For ease of reference we have broken these into five categories:
  1. General
    #	[anything ...]		a comment
    o	[name]			begin/end object context
    xf	[xform]			begin/end transformation context
    i	pathname [xform]	include file (with transformation)
    ies	pathname [-m f][xform]	include IES luminaire (with transformation)
    
  2. Color
    c	[id [= [template]]]	get/set color context
    cxy	x y			set CIE (x,y) chromaticity for current color
    cspec	l_min l_max v1 v2 ...	set relative spectrum for current color
    cct	temperature		set spectrum based on black body temperature
    cmix	w1 c1 w2 c2 ...		mix named colors to make current color
    
  3. Material
    m	[id [= [template]]]	get/set material context
    sides	{1|2}			set number of sides for current material
    rd	rho_d			set diffuse reflectance for current material
    td	tau_d			set diffuse transmittance for current material
    ed	epsilon_d		set diffuse emittance for current material
    rs	rho_s alpha_r		set specular reflectance for current material
    ts	tau_s alpha_t		set specular transmittance for current material
    ir	n_real n_imag		set index of refraction for current material
    
  4. Vertex
    v	[id [= [template]]]	get/set vertex context
    p	x y z			set point position for current vertex
    n	dx dy dz		set surface normal for current vertex
    
  5. Geometry
    f	v1 v2 v3 ...		polygon using current material, spec. vertices
    sph	vc radius		sphere
    cyl	v1 radius v2		truncated right cylinder (open-ended)
    cone	v1 rad1 v2 rad2		truncated right cone (open-ended)
    prism	v1 v2 v3 ... length	truncated right prism (closed solid)
    ring	vc rmin rmax		circular ring with inner and outer radii
    torus	vc rmin rmax		circular torus with inner and outer radii
    

MGF Translators

MGF Parser Library

Application Notes

Relation to Standard Practices in Computer Graphics

Relation to IESNA LM-63 and Luminaire Catalogs

Credits