--- ray/src/cv/mgflib/mgfdoc.tr 1995/11/22 12:23:27 1.9 +++ ray/src/cv/mgflib/mgfdoc.tr 1995/12/04 12:27:04 1.12 @@ -2501,9 +2501,11 @@ SEE ALSO .NH MGF Translators .LP -Initially, there are four translators for MGF data, but only -one of these is distributed with the MGF parser itself, -.I mgfilt. +Initially, there are five translators for MGF data, but only +two of these are distributed with the MGF parser itself, +.I mgfilt +and +.I mgf2inv. Two of the other translators, .I mgf2rad and @@ -2516,7 +2518,7 @@ package\(dg. nestor.epfl.ch, or by WWW from "http://radsite.lbl.gov/radiance/HOME.html" .FE -A third translator, +The fifth translator, .I mgf2meta, converts to a 2-dimensional line plot, and is also distributed with Radiance. @@ -2533,6 +2535,10 @@ unwanted entities. In future releases of MGF, this utility will also be handy for taking new entities and producing older versions of MGF for translators that have not yet been updated properly. +.LP +Mgf2inv converts from MGF to Inventor or VRML format. +Some information is lost, because these formats do not support +physical light sources or materials. .ds LH Translators .ds RH MGFILT .bp @@ -2595,7 +2601,55 @@ mgfilt f,v,p,xf input.mgf > flatpoly.mgf .SH SEE ALSO .LP -i, mgf2rad, rad2mgf +i, mgf2inv, mgf2rad, rad2mgf +.ds RH MGF2INV +.bp +.SH +NAME +.LP +mgf2inv - convert from MGF to Inventor or VRML format +.SH +SYNOPSIS +.LP +.B mgf2inv +[ +.B "-1|-2|-vrml" +] +[ +.B input .. +] +.SH +DESCRIPTION +.LP +.I Mgf2inv +takes one or more MGF input files and converts it to +Inventor or VRML format. +If the +.I \-1 +option is used, then Inventor 1.0 ASCII output is produced. +If the +.I \-2 +option is used, then Inventor 2.0 ASCII output is produced. +(This is the default.)\0 +If the +.I \-vrml +option is used, then VRML 1.0 ASCII output is produced. +.LP +This converter does not work properly for light sources, since +the output formats do not support IES-type luminaires with recorded +distributions. +Also, some material information may be lost because Inventor lacks +a physically valid reflectance model. +.SH +EXAMPLES +.LP +To take an MGF file and convert it to VRML format: +.IP +mgf2inv -vrml myscene.mgf > myscene.iv +.SH +SEE ALSO +.LP +mgf2rad, mgfilt, rad2mgf .ds RH MGF2RAD .bp .SH @@ -3278,8 +3332,9 @@ and return one of the non-zero values from "parser.h" #define MG_ESEEK 9 /* file seek error */ #define MG_EBADMAT 10 /* bad material specification */ #define MG_ELINE 11 /* input line too long */ +#define MG_ECNTXT 12 /* unmatched context close */ -#define MG_NERRS 12 +#define MG_NERRS 13 .DE If it is inappropriate to send output to standard error, the calling program should use the routines listed under @@ -3363,10 +3418,10 @@ The function reads the next input line from the current file, returning the number of characters in the line, or zero if the end of file is reached or there is a file error. -If the last character read in the input line is not a newline, +If the value returned equals MG_MAXLINE-1, then the input line was too long, and you should return an MG_ELINE error. -The function skips over escaped newlines, and keeps track of the +The function keeps track of the line number in the current file context .I mg_file, which also contains the line that was read.