home *** CD-ROM | disk | FTP | other *** search
- #
- # Simple molecule - 8 atoms connected as a cube.
- #
-
- tm = time(true);
-
- save_res = resolution;
- save_view = view_mat;
-
- view_mat = view_mat * scale(vector(0.6, 0.6, 0.6)) *
- rotx(20) * roty(45) *
- trans(vector(-0.3, 0.2, 0.0));
-
- resolution = 8;
- S1 = sphere(vector(0.0, 0.0, 0.0), 0.2);
- S2 = sphere(vector(1.0, 0.0, 0.0), 0.2);
-
- resolution = 4;
- C1 = cylin(vector(0.0, 0.0, 0.0), vector(1.0, 0.0, 0.0), 0.05);
-
- view(list(S1, S2, C1), true);
-
- B1 = S1 + S2 + C1;
- free(S1);
- free(S2);
- free(C1);
- B2 = B1 * trans(vector(0.0, 1.0, 0.0));
-
- view(list(B1, B2), true);
-
- C2 = cylin(vector(0.0, 0.0, 0.0), vector(0.0, 1.0, 0.0), 0.05);
- C3 = cylin(vector(1.0, 0.0, 0.0), vector(0.0, 1.0, 0.0), 0.05);
-
- B12 = B1 + B2 + (C2 + C3);
- free(B1);
- free(B2);
- free(C2);
- free(C3);
- B34 = B12 * trans(vector(0.0, 0.0, 1.0));
-
- view(list(B12, B34), true);
-
- C4 = cylin(vector(0.0, 0.0, 0.0), vector(0.0, 0.0, 1.0), 0.05);
- C5 = cylin(vector(0.0, 1.0, 0.0), vector(0.0, 0.0, 1.0), 0.05);
- C6 = cylin(vector(1.0, 0.0, 0.0), vector(0.0, 0.0, 1.0), 0.05);
- C7 = cylin(vector(1.0, 1.0, 0.0), vector(0.0, 0.0, 1.0), 0.05);
-
- B1234 = B12 + B34 + (C4 + C5 + C6 + C7);
-
- free(B12);
- free(B34);
- free(C4);
- free(C5);
- free(C6);
- free(C7);
-
- tm = time(false);
- tm; # In Seconds
-
- beep(700,200);
- interact(list(B1234), 0);
-
- mdump("molecule", view_mat);
- gdump("molecule", B1234);
-
- resolution = save_res;
- view_mat = save_view;
-