431 |
|
sufficient. |
432 |
|
The following transformation flags and |
433 |
|
parameters are defined: |
434 |
< |
.TS I |
434 |
> |
.TS |
435 |
> |
center; |
436 |
|
l l. |
437 |
|
-t dx dy dz translate objects along the given vector |
438 |
|
-rx degrees rotate objects about the X-axis |
547 |
|
The following example of a simple room with a single door |
548 |
|
and six file cabinets shows MGF in action, with copious comments to |
549 |
|
help explain what's going on. |
550 |
+ |
.LP |
551 |
|
.DS |
552 |
|
# "ceiling_tile" is a diffuse white surface with 75% reflectance: |
553 |
|
# Create new named material context and clear it |
774 |
|
For ease of reference we have broken these into five categories: |
775 |
|
.IP 1. |
776 |
|
General |
777 |
< |
.TS I |
777 |
> |
.TS |
778 |
|
lw(.75i) lw(1.75i) lw(3i). |
779 |
|
# [anything ...] a comment |
780 |
|
o [name] begin/end object context |
784 |
|
.TE |
785 |
|
.IP 2. |
786 |
|
Color |
787 |
< |
.TS I |
787 |
> |
.TS |
788 |
|
lw(.75i) lw(1.75i) lw(3i). |
789 |
|
c [id [= [template]]] get/set color context |
790 |
|
cxy x y set CIE (x,y) chromaticity for current color |
2697 |
|
SEE ALSO |
2698 |
|
.LP |
2699 |
|
ies2rad(1), mgf2meta(1), obj2rad(1), oconv(1), rad2mgf(1), xform(1) |
2700 |
< |
.ds RH |
2699 |
< |
RAD2MGF |
2700 |
> |
.ds RH RAD2MGF |
2701 |
|
.bp |
2702 |
|
.SH |
2703 |
|
NAME |
2986 |
|
|
2987 |
|
if (ac < 4) /* check # arguments */ |
2988 |
|
return(MG_EARGC); |
2989 |
< |
printf("face\n"); /* begin face output */ |
2989 |
> |
printf("face\\\\n"); /* begin face output */ |
2990 |
|
for (i = 1; i < ac; i++) { |
2991 |
|
if ((vp = c_getvert(av[i])) == NULL) /* vertex from name */ |
2992 |
|
return(MG_EUNDEF); |
2993 |
|
xf_xfmpoint(vert, vp->p); /* apply transform */ |
2994 |
< |
printf("%15.9f %15.9f %15.9f\n", |
2994 |
> |
printf("%15.9f %15.9f %15.9f\\\\n", |
2995 |
|
vert[0], vert[1], vert[2]); /* output vertex */ |
2996 |
|
} |
2997 |
< |
printf(";\\n"); /* end of face output */ |
2997 |
> |
printf(";\\\\n"); /* end of face output */ |
2998 |
|
return(MG_OK); /* normal exit */ |
2999 |
|
} |
3000 |
|
|
3128 |
|
#define MG_E_FACE 9 /* f */ |
3129 |
|
#define MG_E_INCLUDE 10 /* i */ |
3130 |
|
#define MG_E_IES 11 /* ies */ |
3131 |
< |
#define MG_E_IR 12 /* ir */ |
3131 |
> |
#define MG_E_IR 12 /* ir */ |
3132 |
|
#define MG_E_MATERIAL 13 /* m */ |
3133 |
|
#define MG_E_NORMAL 14 /* n */ |
3134 |
|
#define MG_E_OBJECT 15 /* o */ |
3268 |
|
#define MG_EUNK 1 /* unknown entity */ |
3269 |
|
#define MG_EARGC 2 /* wrong number of arguments */ |
3270 |
|
#define MG_ETYPE 3 /* argument type error */ |
3271 |
< |
#define MG_EILL 4 /* illegal argument value */ |
3271 |
> |
#define MG_EILL 4 /* illegal argument value */ |
3272 |
|
#define MG_EUNDEF 5 /* undefined reference */ |
3273 |
|
#define MG_ENOFILE 6 /* cannot open input file */ |
3274 |
|
#define MG_EINCL 7 /* error in included file */ |
4276 |
|
.SH |
4277 |
|
NAME |
4278 |
|
.LP |
4279 |
< |
xf_xfmpoint xf_xfmvect, xf_rotvect, xf_scale - apply current |
4279 |
> |
xf_xfmpoint, xf_xfmvect, xf_rotvect, xf_scale - apply current |
4280 |
|
transformation |
4281 |
|
.SH |
4282 |
|
SYNOPSIS |
4305 |
|
.I pold, |
4306 |
|
scaling, rotating and moving it to its proper location, which is put in |
4307 |
|
.I pnew. |
4308 |
< |
(The two arguments may point to the same vector.)\0 |
4308 |
> |
(As for |
4309 |
> |
.I xf_xfmvect |
4310 |
> |
and |
4311 |
> |
.I xf_rotvect, |
4312 |
> |
the two arguments may point to the same vector.)\0 |
4313 |
|
.LP |
4314 |
|
The |
4315 |
|
.I xf_xfmvect |
4317 |
|
.I vold, |
4318 |
|
scaling and rotating it to its proper location, which is put in |
4319 |
|
.I vnew. |
4315 |
– |
(The two arguments may point to the same vector.)\0 |
4320 |
|
The only difference between |
4321 |
|
.I xf_xfmpoint |
4322 |
|
and |
4329 |
|
.I nold |
4330 |
|
using the current transformation, and stores the result in |
4331 |
|
.I nnew. |
4328 |
– |
(The two arguments may point to the same vector.)\0 |
4332 |
|
No translation or scaling is applied, which is the appropriate |
4333 |
|
action for surface normal vectors for example. |
4334 |
|
.LP |