#include #include #include #include #include "movie.h" #include "putable.h" using namespace std; int main(int argc, char **argv) { //The viewpoint is picture::dmax from the origin //along the hypotenuse of a 30-60-90 right triangle. const xyz viewpoint(0, -sqrt(3) * picture::dmax / 2, picture::dmax / 2); putable Sun; Sun .sphere() .scale(picture::ymax / 15.0); putable Mercury; Mercury .circle() .scale(picture::ymax / 3.0) .rot(xyz(), viewpoint, pi / 2); putable Venus; Venus .circle() .scale(picture::ymax / 3.0); putable Earth; Earth .circle() .scale(picture::ymax) .rot(xyz(), viewpoint, -pi / 3); putable Mars; Mars .circle() .scale(picture::ymax); putable Jupiter; Jupiter .circle() .scale(picture::ymax) .rot(xyz(), viewpoint, pi / 3); const picture empty; picture atom(viewpoint); atom << Sun << Mercury << Venus << Earth << Mars << Jupiter; movie(empty, atom).write( "fade_in_atom.gif", "empty", "atom"); putable Mercury2; Mercury2 .circle() .scale(picture::ymax / 3.0, picture::ymax / 2.0) .rot(xyz(), viewpoint, pi / 2, 0.0); putable Earth2; Earth2 .circle() .scale(picture::ymax, 5.0 * picture::ymax / 6) .rot(xyz(), viewpoint, -pi / 3, 0); putable Jupiter2; Jupiter2 .circle() .scale(picture::ymax, 7.0 * picture::ymax / 6.0) .rot(xyz(), viewpoint, pi / 3, 0); movie atom_to_solar( constant(viewpoint), constant(xyz()), constant(picture::dmax), 2 * movie::fs ); atom_to_solar << Sun << Mercury2 << Venus << Earth2 << Mars << Jupiter2; atom_to_solar.write("atom_to_solar.gif", "atom", "solar system"); putable Mercury3; Mercury3 .circle() .scale(picture::ymax / 2.0); putable Earth3; Earth3 .circle() .scale(5.0 * picture::ymax / 6); putable Jupiter3; Jupiter3 .circle() .scale(7.0 * picture::ymax / 6.0); movie solar_to_edge( xarc(viewpoint, xyz(0, -picture::dmax, 0)), constant(xyz()), constant(picture::dmax) ); /* cerr << "end of solar to edge: " << setprecision(9) << solar_to_edge.v[solar_to_edge.v.size() - 1].viewpoint << "\n"; */ solar_to_edge << Sun << Mercury3 << Venus << Earth3 << Mars << Jupiter3; solar_to_edge.write("solar_to_edge.gif", "solar system", "edge-on"); picture edge(xyz(0, -picture::dmax, 0)); //cerr << "fade out: " << edge.viewpoint << "\n"; edge << Sun << Mercury3 << Venus << Earth3 << Mars << Jupiter3; movie(edge, empty).write( "fade_out_edge.gif", "edge-on", "empty"); return EXIT_SUCCESS; }