1 |
+ |
#define _FILE_OFFSET_BITS 64 |
2 |
+ |
|
3 |
|
#include <stdio.h> |
4 |
|
#include <stdlib.h> |
5 |
|
#include <string.h> |
452 |
|
} else { |
453 |
|
current_frame->r[i].hasVector = 0; |
454 |
|
} |
455 |
+ |
|
456 |
+ |
if (nTokens >= 10) { |
457 |
+ |
foo = strtok(NULL, " ,;\t"); |
458 |
+ |
(void)sscanf(foo, "%lf", ¤t_frame->r[i].vx); |
459 |
+ |
foo = strtok(NULL, " ,;\t"); |
460 |
+ |
(void)sscanf(foo, "%lf", ¤t_frame->r[i].vy); |
461 |
+ |
foo = strtok(NULL, " ,;\t"); |
462 |
+ |
(void)sscanf(foo, "%lf", ¤t_frame->r[i].vz); |
463 |
+ |
current_frame->r[i].hasSecondVector = 1; |
464 |
+ |
} else { |
465 |
+ |
current_frame->r[i].hasSecondVector = 0; |
466 |
+ |
} |
467 |
+ |
|
468 |
+ |
|
469 |
+ |
|
470 |
|
} |
471 |
|
currentCount++; |
472 |
|
|
549 |
|
out_coords[j].uz = temp_frame->r[j].uz + dz * (i+1); |
550 |
|
} |
551 |
|
|
552 |
+ |
if (current_frame->r[j].hasSecondVector) { |
553 |
+ |
dx = current_frame->r[j].vx - temp_frame->r[j].vx; |
554 |
+ |
dy = current_frame->r[j].vy - temp_frame->r[j].vy; |
555 |
+ |
dz = current_frame->r[j].vz - temp_frame->r[j].vz; |
556 |
+ |
|
557 |
+ |
dx /= (double)(n_interpolate + 1); |
558 |
+ |
dy /= (double)(n_interpolate + 1); |
559 |
+ |
dz /= (double)(n_interpolate + 1); |
560 |
+ |
|
561 |
+ |
out_coords[j].hasVector = current_frame->r[j].hasSecondVector; |
562 |
+ |
out_coords[j].vx = temp_frame->r[j].vx + dx * (i+1); |
563 |
+ |
out_coords[j].vy = temp_frame->r[j].vy + dy * (i+1); |
564 |
+ |
out_coords[j].vz = temp_frame->r[j].vz + dz * (i+1); |
565 |
+ |
} |
566 |
+ |
|
567 |
|
if (current_frame->r[j].hasCharge) { |
568 |
|
dx = current_frame->r[j].charge - temp_frame->r[j].charge; |
569 |
|
|
631 |
|
out_coords[i].uz = current_frame->r[i].uz; |
632 |
|
} |
633 |
|
|
634 |
+ |
if (current_frame->r[i].hasSecondVector) { |
635 |
+ |
out_coords[i].hasSecondVector = current_frame->r[i].hasSecondVector; |
636 |
+ |
out_coords[i].vx = current_frame->r[i].vx; |
637 |
+ |
out_coords[i].vy = current_frame->r[i].vy; |
638 |
+ |
out_coords[i].vz = current_frame->r[i].vz; |
639 |
+ |
} |
640 |
+ |
|
641 |
|
if (current_frame->r[i].hasCharge) { |
642 |
|
out_coords[i].hasCharge = current_frame->r[i].hasCharge; |
643 |
|
out_coords[i].charge = current_frame->r[i].charge; |
707 |
|
fprintf(out_file, |
708 |
|
"// The following script was automatically generated by:\n" |
709 |
|
"// xyz2pov Copyright 2001 by MATTHEW A. MEINEKE\n" |
710 |
+ |
"#include \"colors.inc\"\n" |
711 |
+ |
"#include \"math.inc\"\n" |
712 |
|
"\n" |
713 |
|
"\n" |
714 |
|
"background { rgb <1.0, 1.0, 1.0> }\n" |
771 |
|
"#declare boxCenterX = cameraLookX;\n" |
772 |
|
"#declare boxCenterY = cameraLookY;\n" |
773 |
|
"#declare boxCenterZ = cameraLookZ;\n" |
774 |
+ |
"#declare fn = function(x,y,z) {(y+1)/2}\n" |
775 |
+ |
"#declare grad1 = pigment { function { fn(x, y, z) } color_map {[0.0 rgb <0,0,0>] [1.0 rgb <3,0,0>]} };\n" |
776 |
+ |
"#declare grad2 = pigment { function { fn(x, y, z) } rotate 120*z color_map {[0.0 rgb <0,0,0>] [1.0 rgb <0,3,0>]} };\n" |
777 |
+ |
"#declare grad3 = pigment { function { fn(x, y, z) } rotate 240*z color_map {[0.0 rgb <0,0,0>] [1.0 rgb <0,0,3>]} };\n" |
778 |
+ |
"#declare fnz = function(x,y,z) {(z+1)/2}\n" |
779 |
+ |
"#declare gradz = pigment { function { fnz(x, y, z) } color_map {[0.0 rgb <0,0,0>] [1.0 rgb <1,1,1>]} };\n" |
780 |
|
"\n" |
781 |
|
"// declare the cameras and the light sources\n" |
782 |
|
"\n" |