Changeset 5380
- Timestamp:
- May 29, 2008, 4:00:58 PM (16 years ago)
- Location:
- anuga_work/development/anugavis/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/camera.c
r5379 r5380 14 14 15 15 static const vector up = {0.0, 0.0, 1.0}; 16 #include <stdio.h> 16 17 17 void camera_pitch(float theta){ 18 18 float c = cos(theta); -
anuga_work/development/anugavis/src/events.c
r5379 r5380 18 18 #include "globals.h" 19 19 #include "height_quantity.h" 20 21 #define MIN(a, b) ((a) < (b) ? (a) : (b))22 #define MAX(a, b) ((a) > (b) ? (a) : (b))23 20 24 21 /* Called for each SDL_KEYDOWN or SDL_KEYUP event. Returns 1 if we're not stopping, else 0. */ -
anuga_work/development/anugavis/src/globals.h
r5339 r5380 18 18 #include "height_quantity.h" 19 19 20 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 21 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 22 20 23 typedef struct{ 21 24 SDL_Surface *screen; … … 32 35 int *volumes; 33 36 34 GLfloat pitch; 35 GLfloat yaw; 36 /* track is forward/back motion, strafe is side/side motion */ 37 GLfloat track; 38 GLfloat strafe; 37 /* Extents */ 38 double minX; 39 double maxX; 40 double minY; 41 double maxY; 42 39 43 GLfloat eye[3]; 40 44 GLfloat focus[3]; -
anuga_work/development/anugavis/src/init.c
r5339 r5380 22 22 #include "init.h" 23 23 #include "netcdf_util.h" 24 #include "vector.h" 24 25 #include "xfunctions.h" 25 26 26 27 int AnugaVis_Init(int width, int height, const char *swwFilePath){ 27 28 int ncstatus; 29 vector releye; 30 unsigned int i; 28 31 GLfloat lightAmbient[] = {0.0, 0.0, 0.0, 1.0}; 29 32 GLfloat lightDiffuse[] = {1.0, 1.0, 1.0, 1.0}; … … 34 37 anugavis.volumes = NULL; 35 38 36 anugavis.pitch = 0.0;37 anugavis.yaw = 0.0;38 anugavis.track = 0.0;39 anugavis.strafe = 0.0;40 /* FIXME derive this from the dataset? */41 anugavis.eye[0] = 1.0;42 anugavis.eye[1] = 1.0;43 anugavis.eye[2] = 40.0;44 anugavis.focus[0] = 0.0;45 anugavis.focus[1] = 0.0;46 anugavis.focus[2] = 0.0;47 39 anugavis.heights = NULL; 48 40 if((SDL_Init(SDL_INIT_VIDEO) == -1) || … … 104 96 return -1; 105 97 } 98 99 for(i = 0 ; i < anugavis.number_of_points ; i++){ 100 anugavis.minX = MIN(anugavis.minX, anugavis.x[i]); 101 anugavis.maxX = MAX(anugavis.maxX, anugavis.x[i]); 102 anugavis.minY = MIN(anugavis.minY, anugavis.y[i]); 103 anugavis.maxY = MAX(anugavis.maxY, anugavis.y[i]); 104 } 105 anugavis.eye[0] = anugavis.minX; 106 anugavis.eye[1] = anugavis.minY; 107 anugavis.eye[2] = 0; 108 anugavis.focus[0] = anugavis.minX + (anugavis.maxX - anugavis.minX) / 2; 109 anugavis.focus[1] = anugavis.minY + (anugavis.maxY - anugavis.minY) / 2; 110 anugavis.focus[2] = 0; 111 vsub(anugavis.eye, anugavis.focus, releye); 112 anugavis.eye[2] = vlen(releye); 106 113 return 0; 107 114 }
Note: See TracChangeset
for help on using the changeset viewer.