Changeset 5272
- Timestamp:
- May 2, 2008, 2:41:50 PM (17 years ago)
- Location:
- anuga_work/development/anugavis
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/configure.ac
r5269 r5272 15 15 AX_CHECK_GLU 16 16 AM_PATH_SDL([1.2.12], [], [AC_MSG_ERROR([SDL is required to build.])]) 17 AC_SUBST([SDL_LIBPATH])18 17 AC_SEARCH_LIBS([nc_open], [netcdf], [], 19 18 [AC_MSG_ERROR([Can't link the NetCDF library. (LDFLAGS?)])]) -
anuga_work/development/anugavis/src/Makefile.am
r5267 r5272 15 15 netcdf_util.c \ 16 16 netcdf_util.h \ 17 vector.c \ 18 vector.h \ 17 19 xfunctions.c \ 18 20 xfunctions.h … … 23 25 anugavis_simple_SOURCES = anugavis_simple.c 24 26 anugavis_simple_CFLAGS = @SDL_CFLAGS@ @GLU_CFLAGS@ 25 anugavis_simple_LDADD = libanugavis.a @SDL_LIBS@ @GLU_LIBS@27 anugavis_simple_LDADD = libanugavis.a -lm @SDL_LIBS@ @GLU_LIBS@ -
anuga_work/development/anugavis/src/height_quantity.c
r5271 r5272 20 20 #include "height_quantity.h" 21 21 #include "netcdf_util.h" 22 #include "vector.h" 22 23 #include "xfunctions.h" 23 24 … … 27 28 unsigned int vertex; 28 29 int vertIndex; 29 int x[3]; 30 int y[3]; 31 int z[3]; 30 vector vs[3]; 31 vector v1; 32 vector v2; 33 vector normal; 32 34 float *heights = xmalloc(sizeof(float) 33 35 * anugavis.number_of_points … … 47 49 for(vertex = 0 ; vertex < 3 ; vertex++){ /* Calculate normal */ 48 50 vertIndex = anugavis.volumes[vol*anugavis.number_of_vertices + vertex]; 49 x[vertex] = anugavis.x[vertIndex];50 y[vertex] = anugavis.y[vertIndex];51 z[vertex] = heights[frame *anugavis.number_of_timesteps + vertIndex];51 vs[vertex][0] = anugavis.x[vertIndex]; 52 vs[vertex][1] = anugavis.y[vertIndex]; 53 vs[vertex][2] = heights[frame*anugavis.number_of_timesteps + vertIndex]; 52 54 } 53 glNormal3f((y[1] - y[0]) * (z[2] - z[0]) - (z[1] - z[0]) * (y[2] - y[0]), 54 (z[1] - z[0]) * (x[2] - x[0]) - (x[1] - x[0]) * (z[2] - z[0]), 55 (x[1] - x[0]) * (y[2] - y[0]) - (y[1] - y[0]) * (x[2] - x[0])); 55 vsub(vs[1], vs[0], v1); 56 vsub(vs[2], vs[0], v2); 57 vcross(v1, v2, normal); 58 /* FIXME: Need to ensure that normal is pointing upward. */ 59 glNormal3fv(normal); 56 60 for(vertex = 0 ; vertex < anugavis.number_of_vertices ; vertex++){ 57 61 vertIndex = anugavis.volumes[vol*anugavis.number_of_vertices + vertex];
Note: See TracChangeset
for help on using the changeset viewer.