73 |
|
if (*ap <= FTINY) |
74 |
|
*ap = va * *xp / *yp; /* compute pixel aspect */ |
75 |
|
else if (va * *xp > *ap * *yp) |
76 |
< |
*xp = *yp / va * *ap; /* reduce x resolution */ |
76 |
> |
*xp = *yp / va * *ap + .5; /* reduce x resolution */ |
77 |
|
else |
78 |
< |
*yp = *xp * va / *ap; /* reduce y resolution */ |
78 |
> |
*yp = *xp * va / *ap + .5; /* reduce y resolution */ |
79 |
|
} |
80 |
|
|
81 |
|
|
119 |
|
if (zp != NULL) |
120 |
|
*zp = DOT(disp,v->vdir); |
121 |
|
} else { /* perspective view */ |
122 |
< |
d = 1.0/DOT(disp,v->vdir); |
122 |
> |
d = DOT(disp,v->vdir); |
123 |
|
if (zp != NULL) { |
124 |
|
*zp = sqrt(DOT(disp,disp)); |
125 |
|
if (d < 0.0) |
126 |
|
*zp = -*zp; |
127 |
|
} |
128 |
< |
disp[0] *= d; |
129 |
< |
disp[1] *= d; |
130 |
< |
disp[2] *= d; |
128 |
> |
if (d < 0.0) /* fold pyramid */ |
129 |
> |
d = -d; |
130 |
> |
if (d > FTINY) { |
131 |
> |
d = 1.0/d; |
132 |
> |
disp[0] *= d; |
133 |
> |
disp[1] *= d; |
134 |
> |
disp[2] *= d; |
135 |
> |
} |
136 |
|
} |
137 |
|
*xp = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff; |
138 |
|
*yp = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff; |
148 |
|
#define check(c,n) if ((av[0][c]&&av[0][c]!=' ') || n>=ac) return(-1) |
149 |
|
extern double atof(); |
150 |
|
|
151 |
< |
if (av[0][0] != '-' || av[0][1] != 'v') |
151 |
> |
if (ac <= 0 || av[0][0] != '-' || av[0][1] != 'v') |
152 |
|
return(-1); |
153 |
|
switch (av[0][2]) { |
154 |
|
case 't': /* type */ |
210 |
|
|
211 |
|
while (*s == ' ') |
212 |
|
s++; |
213 |
< |
do { |
213 |
> |
while (*s) { |
214 |
|
ac = 0; |
215 |
|
do { |
216 |
|
av[ac++] = s; |
223 |
|
if (na+1 < ac) |
224 |
|
s = av[na+1]; |
225 |
|
nvopts++; |
226 |
< |
} |
227 |
< |
} while (*s); |
226 |
> |
} else if (ac > 1) |
227 |
> |
s = av[1]; |
228 |
> |
} |
229 |
|
return(nvopts); |
230 |
|
} |
231 |
|
|
239 |
|
fprintf(fp, " -vd %.6g %.6g %.6g", vp->vdir[0], vp->vdir[1], vp->vdir[2]); |
240 |
|
fprintf(fp, " -vu %.6g %.6g %.6g", vp->vup[0], vp->vup[1], vp->vup[2]); |
241 |
|
fprintf(fp, " -vh %.6g -vv %.6g", vp->horiz, vp->vert); |
242 |
< |
fprintf(fp, " -vs %d -vl %d", vp->hoff, vp->voff); |
242 |
> |
fprintf(fp, " -vs %.6g -vl %.6g", vp->hoff, vp->voff); |
243 |
|
} |
244 |
|
|
245 |
|
|