4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Good ROcking Metal Altar for Chronical Sinners
33 static char *SRCID_3dview_h = "$Id$";
41 typedef real mat4[4][4];
47 vec4 eye,origin; /* The eye and origin position */
48 mat4 proj; /* Projection matrix */
49 mat4 Rot; /* Total rotation matrix */
50 real sc_x,sc_y; /* Scaling for aspect ratio */
53 extern void print_m4(FILE *fp,char *s,mat4 A);
55 extern void print_v4(FILE *fp,char *s,int dim,real *a);
57 extern void m4_op(mat4 m,rvec x,vec4 v);
59 extern void unity_m4(mat4 m);
61 extern void mult_matrix(mat4 A, mat4 B, mat4 C);
63 extern void rotate(int axis, real angle, mat4 A);
65 extern void translate(real tx, real ty, real tz, mat4 A);
67 extern void m4_op(mat4 m,rvec x,vec4 v);
69 extern void calculate_view(t_3dview *view);
71 extern t_3dview *init_view(matrix box);
72 /* Generate the view matrix from the eye pos and the origin,
73 * applying also the scaling for the aspect ration.
74 * There is no accompanying done_view routine: the struct can simply
78 /* The following options are present on the 3d struct:
80 * rotate around the center of the box
84 extern bool zoom_3d(t_3dview *view,real fac);
85 /* Zoom in or out with factor fac, returns TRUE when zoom succesful,
89 extern void rotate_3d(t_3dview *view,int axis,bool bPositive);
90 /* Rotate the eye around the center of the box, around axis */
92 extern void translate_view(t_3dview *view,int axis,bool bPositive);
93 /* Translate the origin at which one is looking */
95 extern void reset_view(t_3dview *view);
96 /* Reset the viewing to the initial view */