ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/mgfdoc.tr
(Generate patch)

Comparing ray/src/cv/mgflib/mgfdoc.tr (file contents):
Revision 1.11 by greg, Fri Dec 1 11:07:51 1995 UTC vs.
Revision 1.16 by greg, Tue Mar 18 11:43:22 1997 UTC

# Line 5 | Line 5
5   .vs 12
6   .nr PD .5v
7   .ds LF MGF
8 < .ds RF Version 1.0
9 < .DA May 1995
8 > .ds RF Version 1.1
9 > .\" !Remember to update date on each modification!
10 > .DA February 1996
11   .TL
12   The Materials and Geometry Format
13   .AU
# Line 42 | Line 43 | and sample scenes and objects at the web site,
43   "http://radsite.lbl.gov/mgf/HOME.html".
44   .RE
45   .LP
46 < The standard parser provides both immediate and a long-term
46 > The standard parser provides both immediate and long-term
47   benefits, since it presents a programming interface that is more
48   stable even than the language itself.
49   Unlike AutoCAD DXF and other de facto standards, a change to the
# Line 232 | Line 233 | p      x y z   set point position for current vertex
233   n       dx dy dz        set surface normal for current vertex
234   _       _       _
235   f       v1 v2 v3 ...    polygon using current material, spec. vertices
236 + fh      v1 v2 v3 - ...  face with explicit holes
237   sph     vc radius       sphere
238   cyl     v1 radius v2    truncated right cylinder (open-ended)
239   cone    v1 rad1 v2 rad2 truncated right cone (open-ended)
# Line 282 | Line 284 | ring, torus, prism
284   T}
285   Material        m       2-sided black   T{
286   sides, rd, td,
287 < ed, rs, ts
287 > ed, rs, ts, ir
288   T}      T{
289   f, sph, cyl, cone,
290   ring, torus, prism
# Line 1674 | Line 1676 | EXAMPLE
1676   # A 100-watt incandescent bulb (1600 lumens) modeled as a sphere
1677   m
1678          c
1679 <        cct 3000
1679 >                cct 3000
1680          ed 87712
1681   v cent =
1682          p 0 0 0
# Line 2068 | Line 2070 | when normals are used.
2070   Also, specified normals should point in the general direction of the
2071   surface for best results.
2072   .LP
2073 < There is no explicit representation of holes in MGF.  A hole must be
2074 < represented implicitly by connecting vertices to form "seams."  For
2073 > There is no explicit representation of holes in this entity, but see
2074 > the
2075 > .UL fh
2076 > entity for an alternative specification.
2077 > .LP
2078 > A hole may be represented implicitly in a face entity
2079 > by connecting vertices to form "seams."
2080 > For
2081   example, a wall with a window in it might look as shown in Figure 1.
2082   In many systems, the wall itself would be represented with the first
2083   list of vertices, (v1,v2,v3,v4) and the hole associated with that
2084 < wall as a second set of vertices (v5,v6,v7,v8).  In MGF, we must
2084 > wall as a second set of vertices (v5,v6,v7,v8).
2085 > Using the face entity, we must
2086   give the whole thing as a single polygon, connecting the vertices so
2087   as to create a "seam," as shown in Figure 2.
2088 < This could be written in MGF as "f v1 v2 v3 v4 v5 v6 v7 v8 v5 v4".
2088 > This could be written as "f v1 v2 v3 v4 v5 v6 v7 v8 v5 v4".
2089   .LP
2090   It is very important that the order of the hole be opposite to the
2091   order of the outer perimeter, otherwise the polygon will be
# Line 2125 | Line 2134 | SEE ALSO
2134   .LP
2135   .UL cone,
2136   .UL cyl,
2137 + .UL fh,
2138   .UL m,
2139   .UL prism,
2140   .UL ring,
2141   .UL sph,
2142   .UL torus,
2143   .UL v
2144 + .ds RH FH
2145 + .bp
2146 + .SH
2147 + NAME
2148 + .LP
2149 + fh - create a polygonal face with explicit holes
2150 + .SH
2151 + SYNOPSIS
2152 + .LP
2153 + .B fh
2154 + .I "p1 p2 ... - h1.1 h1.2 ... - h2.1 h2.2 ..."
2155 + .SH
2156 + DESCRIPTION
2157 + .LP
2158 + Create a polygonal face with optional holes made of the current material.
2159 + The first contour is the outer perimeter, with vertices given in
2160 + counter-clockwise order as seen from the front side (the same as the
2161 + .UL f
2162 + entity).
2163 + A hole is indicated by a hyphen ('-') followed by the hole's
2164 + vertices, given in clockwise order as seen from the front side.
2165 + Multiple hole contours are separated by additional hyphens.
2166 + There must be at least three vertices for each contour, and the
2167 + last vertex is implicitly connected to the first.
2168 + If any vertex is undefined, an error will result.
2169 + .LP
2170 + If any vertices have associated surface normals, they will be used
2171 + instead of the average plane normal, though it is safest to specify
2172 + either all normals or no normals, and to stick with triangles
2173 + when normals are used.
2174 + Also, specified normals should point in the general direction of the
2175 + surface for best results.
2176 + .SH
2177 + EXAMPLE
2178 + .DS
2179 + # Make a wall with a window using an explicit hole.
2180 + # (See Figures 1 and 2.)
2181 + fh v1 v2 v3 v4 - v5 v6 v7 v8
2182 + .DE
2183 + .SH
2184 + SEE ALSO
2185 + .LP
2186 + .UL cone,
2187 + .UL cyl,
2188 + .UL f,
2189 + .UL m,
2190 + .UL prism,
2191 + .UL ring,
2192 + .UL sph,
2193 + .UL torus,
2194 + .UL v
2195   .ds RH SPH
2196   .bp
2197   .SH
# Line 2501 | Line 2562 | SEE ALSO
2562   .NH
2563   MGF Translators
2564   .LP
2565 < Initially, there are four translators for MGF data, but only
2566 < one of these is distributed with the MGF parser itself,
2567 < .I mgfilt.
2565 > Initially, there are six translators for MGF data, and
2566 > three of these are distributed with the MGF parser itself,
2567 > .I mgfilt,
2568 > .I mgf2inv
2569 > and
2570 > .I 3ds2mgf.
2571   Two of the other translators,
2572   .I mgf2rad
2573   and
# Line 2516 | Line 2580 | package\(dg.
2580   nestor.epfl.ch, or by WWW from
2581   "http://radsite.lbl.gov/radiance/HOME.html"
2582   .FE
2583 < A third translator,
2583 > The sixth translator,
2584   .I mgf2meta,
2585   converts to a 2-dimensional line plot, and is also
2586   distributed with Radiance.
# Line 2533 | Line 2597 | unwanted entities.
2597   In future releases of MGF, this utility will also be handy for
2598   taking new entities and producing older versions of MGF for
2599   translators that have not yet been updated properly.
2600 + .LP
2601 + Mgf2inv converts from MGF to Inventor or VRML format.
2602 + Some information is lost, because these formats do not support
2603 + physical light sources or materials.
2604 + .LP
2605 + 3ds2mgf converts from 3D Studio binary format to MGF.
2606 + Care must be taken to correct for errors in the material descriptions,
2607 + since 3D Studio is completely non-physical.
2608   .ds LH Translators
2609   .ds RH MGFILT
2610   .bp
# Line 2595 | Line 2667 | mgfilt f,v,p,xf input.mgf > flatpoly.mgf
2667   .SH
2668   SEE ALSO
2669   .LP
2670 < i, mgf2rad, rad2mgf
2670 > i, mgf2inv, mgf2rad, rad2mgf
2671 > .ds RH MGF2INV
2672 > .bp
2673 > .SH
2674 > NAME
2675 > .LP
2676 > mgf2inv - convert from MGF to Inventor or VRML format
2677 > .SH
2678 > SYNOPSIS
2679 > .LP
2680 > .B mgf2inv
2681 > [
2682 > .B "-1|-2|-vrml"
2683 > ]
2684 > [
2685 > .B input ..
2686 > ]
2687 > .SH
2688 > DESCRIPTION
2689 > .LP
2690 > .I Mgf2inv
2691 > takes one or more MGF input files and converts it to
2692 > Inventor or VRML format.
2693 > If the
2694 > .I \-1
2695 > option is used, then Inventor 1.0 ASCII output is produced.
2696 > If the
2697 > .I \-2
2698 > option is used, then Inventor 2.0 ASCII output is produced.
2699 > (This is the default.)\0
2700 > If the
2701 > .I \-vrml
2702 > option is used, then VRML 1.0 ASCII output is produced.
2703 > .LP
2704 > This converter does not work properly for light sources, since
2705 > the output formats do not support IES-type luminaires with recorded
2706 > distributions.
2707 > Also, some material information may be lost because Inventor lacks
2708 > a physically valid reflectance model.
2709 > .SH
2710 > EXAMPLES
2711 > .LP
2712 > To take an MGF file and convert it to VRML format:
2713 > .IP
2714 > mgf2inv -vrml myscene.mgf > myscene.iv
2715 > .SH
2716 > SEE ALSO
2717 > .LP
2718 > mgf2rad(1), mgfilt(1), 3ds2mgf(1), rad2mgf(1)
2719 > .ds RH 3DS2MGF
2720 > .bp
2721 > .SH
2722 > NAME
2723 > .LP
2724 > 3ds2mgf - convert 3D Studio binary file to Materials and Geometry Format
2725 > .SH
2726 > SYNOPSIS
2727 > .LP
2728 > .B 3ds2mgf
2729 > .B input
2730 > [
2731 > .B output
2732 > ]
2733 > [
2734 > .B -lMatlib
2735 > ][
2736 > .B -xObjname
2737 > ][
2738 > .B -sAngle
2739 > ][
2740 > .B -aAnimfile
2741 > ][
2742 > .B -fN
2743 > ]
2744 > .SH
2745 > DESCRIPTION
2746 > .LP
2747 > .I 3ds2mgf
2748 > converts a 3D Studio binary scene description
2749 > to the Materials and Geometry Format (MGF).
2750 > If no output file name is given, the input root name
2751 > will be taken as the output root, and an "mgf" extension
2752 > will be added.
2753 > This file will contain any light sources and materials, and an include
2754 > statement for a similarly named file ending in "inc", which will contain
2755 > the MGF geometry of all the translated 3DS meshes.
2756 > .LP
2757 > The MGF material names and properties
2758 > for the surfaces will be those assigned in 3D Studio,
2759 > unless they are named in one or more MGF material libraries given in a
2760 > .I -l
2761 > option.
2762 > .LP
2763 > The
2764 > .I -x
2765 > option may be used to exclude a named object from the output.
2766 > .LP
2767 > The
2768 > .I -s
2769 > option may be used to adjust automatic mesh smoothing such that adjacent
2770 > triangle faces with less than the given angle between them (in degrees)
2771 > will be smoothed.
2772 > A value of zero turns smoothing off.
2773 > The default value is 60 degrees.
2774 > .LP
2775 > The
2776 > .I -a
2777 > option may be used to specify a 3D Studio animation file, and together with the
2778 > .I -f
2779 > option,
2780 > .I 3ds2mgf
2781 > will generate a scene description for the specified frame.
2782 > .LP
2783 > Note that there are no spaces between the options and their arguments.
2784 > .SH
2785 > LIMITATIONS
2786 > .LP
2787 > Obviously, since 3D Studio has no notion of physical materials, the
2788 > translation to MGF material descriptions is very ad hoc, and it will
2789 > usually be necessary to edit the materials and light sources in
2790 > the output file or replace materials with proper entries from a material
2791 > library using the
2792 > .I -l
2793 > option.
2794 > .LP
2795 > With smoothing turned on (i.e., a non-zero value for the
2796 > .I -s
2797 > option), vertices in the MGF output will not be linked in a proper
2798 > mesh for each object.
2799 > This is due to the way the automatic smoothing code was originally
2800 > written, and is too difficult to repair.
2801 > If a good mesh is needed, then smoothing must be turned off.
2802 > .SH
2803 > EXAMPLES
2804 > .LP
2805 > To convert a 3D Studio robot model to MGF without smoothing.
2806 > (Output will be put into "robot.mgf" and "robot.inc".)
2807 > .IP
2808 > 3ds2mgf robot.3ds -s0
2809 > .LP
2810 > To convert a DC10 jet model to MGF using a hand-created material library:
2811 > .IP
2812 > 3ds2mgf dc10.3ds -ldc10mat.mgf
2813 > .SH
2814 > AUTHORS
2815 > .LP
2816 > Steve Anger, Jeff Bowermaster and Greg Ward
2817 > .br
2818 > Extended from 3ds2pov 1.8.
2819 > .SH
2820 > SEE ALSO
2821 > .LP
2822 > mgf2inv(1), mgf2meta(1), mgf2rad(1)
2823   .ds RH MGF2RAD
2824   .bp
2825   .SH
# Line 3270 | Line 3494 | and return one of the non-zero values from "parser.h"
3494   #define MG_EUNK         1               /* unknown entity */
3495   #define MG_EARGC                2               /* wrong number of arguments */
3496   #define MG_ETYPE                3               /* argument type error */
3497 < #define MG_EILL                         4               /* illegal argument value */
3497 > #define MG_EILL                 4               /* illegal argument value */
3498   #define MG_EUNDEF               5               /* undefined reference */
3499   #define MG_ENOFILE              6               /* cannot open input file */
3500   #define MG_EINCL                7               /* error in included file */
# Line 3280 | Line 3504 | and return one of the non-zero values from "parser.h"
3504   #define MG_ELINE                11              /* input line too long */
3505   #define MG_ECNTXT               12              /* unmatched context close */
3506  
3507 < #define MG_NERRS        13
3507 > #define MG_NERRS                13
3508   .DE
3509   If it is inappropriate to send output to standard error, the calling
3510   program should use the routines listed under
# Line 3703 | Line 3927 | To link identical vertices, one must also check that t
3927   transform has not changed, which is uniquely identified by the
3928   global
3929   .I xf_context->xid
3930 < variable, but only if one is using the parser libraries transform
3930 > variable, but only if one is using the parser library's transform
3931   handler.
3932   (See the
3933   .I xf_handler
# Line 4434 | Line 4658 | familiar Gaussian model of MGF.
4658   The hardest part is translating the specular power to a roughness value.
4659   For this, we recommend the following approximation:
4660   .IP
4661 < roughness = 0.6/sqrt(specular_power)
4661 > roughness = sqrt(2/specular_power)
4662   .LP
4663   It is not a perfect correlation, but it is about as close as one can get.
4664   .NH 3

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines