--- ray/src/cv/mgflib/mgfdoc.tr 1995/05/12 14:26:12 1.1 +++ ray/src/cv/mgflib/mgfdoc.tr 1995/06/29 14:40:18 1.4 @@ -431,7 +431,8 @@ Since the arguments are concise and self-explanatory, sufficient. The following transformation flags and parameters are defined: -.TS I +.TS +center; l l. -t dx dy dz translate objects along the given vector -rx degrees rotate objects about the X-axis @@ -546,6 +547,7 @@ Detailed MGF Example The following example of a simple room with a single door and six file cabinets shows MGF in action, with copious comments to help explain what's going on. +.LP .DS # "ceiling_tile" is a diffuse white surface with 75% reflectance: # Create new named material context and clear it @@ -744,9 +746,6 @@ o door o o - i cubfurn.inc -mx -t 405 133.5 0 -o - # Six file cabinets (36" wide each) # ("filecab.inc" was given as an earlier example in Section 1.2) o filecab.x @@ -772,7 +771,7 @@ There are currently 28 entities in the MGF specificati For ease of reference we have broken these into five categories: .IP 1. General -.TS I +.TS lw(.75i) lw(1.75i) lw(3i). # [anything ...] a comment o [name] begin/end object context @@ -782,7 +781,7 @@ ies pathname [-m f][xform] include IES luminaire (with .TE .IP 2. Color -.TS I +.TS lw(.75i) lw(1.75i) lw(3i). c [id [= [template]]] get/set color context cxy x y set CIE (x,y) chromaticity for current color @@ -2695,8 +2694,7 @@ Greg Ward SEE ALSO .LP ies2rad(1), mgf2meta(1), obj2rad(1), oconv(1), rad2mgf(1), xform(1) -.ds RH -RAD2MGF +.ds RH RAD2MGF .bp .SH NAME @@ -2985,15 +2983,15 @@ char **av; if (ac < 4) /* check # arguments */ return(MG_EARGC); - printf("face\n"); /* begin face output */ + printf("face\\\\n"); /* begin face output */ for (i = 1; i < ac; i++) { if ((vp = c_getvert(av[i])) == NULL) /* vertex from name */ return(MG_EUNDEF); xf_xfmpoint(vert, vp->p); /* apply transform */ - printf("%15.9f %15.9f %15.9f\n", + printf("%15.9f %15.9f %15.9f\\\\n", vert[0], vert[1], vert[2]); /* output vertex */ } - printf(";\\n"); /* end of face output */ + printf(";\\\\n"); /* end of face output */ return(MG_OK); /* normal exit */ } @@ -3122,12 +3120,12 @@ following: #define MG_E_CMIX 4 /* cmix */ #define MG_E_CSPEC 5 /* cspec */ #define MG_E_CXY 6 /* cxy */ -#define MG_E_CYL 7 /* cyl */ +#define MG_E_CYL 7 /* cyl */ #define MG_E_ED 8 /* ed */ #define MG_E_FACE 9 /* f */ #define MG_E_INCLUDE 10 /* i */ #define MG_E_IES 11 /* ies */ -#define MG_E_IR 12 /* ir */ +#define MG_E_IR 12 /* ir */ #define MG_E_MATERIAL 13 /* m */ #define MG_E_NORMAL 14 /* n */ #define MG_E_OBJECT 15 /* o */ @@ -3267,7 +3265,7 @@ and return one of the non-zero values from "parser.h" #define MG_EUNK 1 /* unknown entity */ #define MG_EARGC 2 /* wrong number of arguments */ #define MG_ETYPE 3 /* argument type error */ -#define MG_EILL 4 /* illegal argument value */ +#define MG_EILL 4 /* illegal argument value */ #define MG_EUNDEF 5 /* undefined reference */ #define MG_ENOFILE 6 /* cannot open input file */ #define MG_EINCL 7 /* error in included file */ @@ -3289,7 +3287,7 @@ listed above in the native country's language. .SH SEE ALSO .LP -mg_fgetpos, mg_handle, mg_init +mg_fgetpos, mg_handle, mg_init, mg_open .ds RH MG_OPEN .bp .SH @@ -4275,7 +4273,7 @@ mg_init, mg_load, obj_handler, xf_xfmpoint .SH NAME .LP -xf_xfmpoint xf_xfmvect, xf_rotvect, xf_scale - apply current +xf_xfmpoint, xf_xfmvect, xf_rotvect, xf_scale - apply current transformation .SH SYNOPSIS @@ -4304,7 +4302,11 @@ to the point .I pold, scaling, rotating and moving it to its proper location, which is put in .I pnew. -(The two arguments may point to the same vector.)\0 +(As for +.I xf_xfmvect +and +.I xf_rotvect, +the two arguments may point to the same vector.)\0 .LP The .I xf_xfmvect @@ -4312,7 +4314,6 @@ routine applies the current transformation to the vect .I vold, scaling and rotating it to its proper location, which is put in .I vnew. -(The two arguments may point to the same vector.)\0 The only difference between .I xf_xfmpoint and @@ -4325,7 +4326,6 @@ routine rotates the vector .I nold using the current transformation, and stores the result in .I nnew. -(The two arguments may point to the same vector.)\0 No translation or scaling is applied, which is the appropriate action for surface normal vectors for example. .LP @@ -4486,20 +4486,20 @@ and adopt the following code to convert between CIE an #define CIE_y_w 0.3333 #endif -#define CIE_D ( CIE_x_r*(CIE_y_g - CIE_y_b) + \\\\ - CIE_x_g*(CIE_y_b - CIE_y_r) + \\\\ +#define CIE_D ( CIE_x_r*(CIE_y_g - CIE_y_b) + \\ + CIE_x_g*(CIE_y_b - CIE_y_r) + \\ CIE_x_b*(CIE_y_r - CIE_y_g) ) -#define CIE_C_rD ( (1./CIE_y_w) * \\\\ - ( CIE_x_w*(CIE_y_g - CIE_y_b) - \\\\ - CIE_y_w*(CIE_x_g - CIE_x_b) + \\\\ +#define CIE_C_rD ( (1./CIE_y_w) * \\ + ( CIE_x_w*(CIE_y_g - CIE_y_b) - \\ + CIE_y_w*(CIE_x_g - CIE_x_b) + \\ CIE_x_g*CIE_y_b - CIE_x_b*CIE_y_g ) ) -#define CIE_C_gD ( (1./CIE_y_w) * \\\\ - ( CIE_x_w*(CIE_y_b - CIE_y_r) - \\\\ - CIE_y_w*(CIE_x_b - CIE_x_r) - \\\\ +#define CIE_C_gD ( (1./CIE_y_w) * \\ + ( CIE_x_w*(CIE_y_b - CIE_y_r) - \\ + CIE_y_w*(CIE_x_b - CIE_x_r) - \\ CIE_x_r*CIE_y_b + CIE_x_b*CIE_y_r ) ) -#define CIE_C_bD ( (1./CIE_y_w) * \\\\ - ( CIE_x_w*(CIE_y_r - CIE_y_g) - \\\\ - CIE_y_w*(CIE_x_r - CIE_x_g) + \\\\ +#define CIE_C_bD ( (1./CIE_y_w) * \\ + ( CIE_x_w*(CIE_y_r - CIE_y_g) - \\ + CIE_y_w*(CIE_x_r - CIE_x_g) + \\ CIE_x_r*CIE_y_g - CIE_x_g*CIE_y_r ) ) #define CIE_rf (CIE_y_r*CIE_C_rD/CIE_D)