changed reading hint
[gromacs/adressmacs.git] / include / 3dview.h
blobe001d2e2614eab9d58f76fba8ad10e49b0bb7c35
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
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
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Good ROcking Metal Altar for Chronical Sinners
30 #ifndef _3dview_h
31 #define _3dview_h
33 static char *SRCID_3dview_h = "$Id$";
35 #define WW 3
37 typedef real vec4[4];
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);
51 typedef int iv2[2];
53 typedef struct {
54 matrix box;
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 */
59 } t_3dview;
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
67 * be sfree'd.
70 /* The following options are present on the 3d struct:
71 * zoom (scaling)
72 * rotate around the center of the box
73 * reset the view
76 extern bool zoom_3d(t_3dview *view,real fac);
77 /* Zoom in or out with factor fac, returns TRUE when zoom succesful,
78 * FALSE otherwise.
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 */
90 #endif