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$";
39 typedef real mat4
[4][4];
41 extern void m4_op(mat4 m
,rvec x
,vec4 v
);
43 extern void unity_m4(mat4 m
);
45 extern void mult_matrix(mat4 A
, mat4 B
, mat4 C
);
47 extern void rotate(int axis
, real angle
, mat4 A
);
49 extern void translate(real tx
, real ty
, real tz
, mat4 A
);
55 vec4 eye
,origin
; /* The eye and origin position */
56 mat4 proj
; /* Projection matrix */
57 mat4 Rot
; /* Total rotation matrix */
58 real sc_x
,sc_y
; /* Scaling for aspect ratio */
61 extern void m4_op(mat4 m
,rvec x
,vec4 v
);
63 extern t_3dview
*init_view(matrix box
);
64 /* Generate the view matrix from the eye pos and the origin,
65 * applying also the scaling for the aspect ration.
66 * There is no accompanying done_view routine: the struct can simply
70 /* The following options are present on the 3d struct:
72 * rotate around the center of the box
76 extern bool zoom_3d(t_3dview
*view
,real fac
);
77 /* Zoom in or out with factor fac, returns TRUE when zoom succesful,
81 extern void rotate_3d(t_3dview
*view
,int axis
,bool bPositive
);
82 /* Rotate the eye around the center of the box, around axis */
84 extern void translate_view(t_3dview
*view
,int axis
,bool bPositive
);
85 /* Translate the origin at which one is looking */
87 extern void reset_view(t_3dview
*view
);
88 /* Reset the viewing to the initial view */