1 /***********************************************************************/ 2 /* Open Visualization Data Explorer */ 3 /* (C) Copyright IBM Corp. 1989,1999 */ 4 /* ALL RIGHTS RESERVED */ 5 /* This code licensed under the */ 6 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */ 7 /***********************************************************************/ 8 9 10 /* 11 \section{Camera class} 12 The camera object stores the camera parameters specified by the user. 13 The viewing transformation matrix is then computed when it is needed. 14 This could be changed as follows: the camera object will store both 15 the input parameters (e.g. {\tt to}, {\tt from}) and the computed 16 parameters (e.g. the viewing matrix). Each time an input parameter is 17 changed, the computed parameters will be recomputed. This way one could 18 add alternative ways of specifying the view, e.g. viewing direction 19 ({\tt to-from}). 20 */ 21 22 INCLUDE objectClass.X 23 24 SUBCLASS Camera OF Object 25 IMPLEMENTS Delete Copy 26 27 struct camera { /* camera object */ 28 struct object object; /* object preamble */ 29 Point from; /* camera position */ 30 Point to; /* look-at position */ 31 Vector up; /* up vector */ 32 int ortho; /* orthographic projection? */ 33 float width; /* viewport width */ 34 float aspect; /* aspect ratio */ 35 float pix_aspect; /* pixel aspect ratio */ 36 int resolution; /* resolution for image generation */ 37 Matrix m; /* computed camera matrix */ 38 Matrix rot; /* rotation part of matrix */ 39 RGBColor background; /* image background color */ 40 }; 41 42 43